feat: swagger & requests annotations
This commit is contained in:
parent
f42dcce74b
commit
cf0bf5d97e
3 changed files with 12 additions and 5 deletions
6
pom.xml
6
pom.xml
|
@ -28,6 +28,7 @@
|
|||
|
||||
<!-- dependencies -->
|
||||
<wiremock.version>3.5.4</wiremock.version>
|
||||
<openapi.version>2.5.0</openapi.version>
|
||||
|
||||
<!-- plugins -->
|
||||
<jsonschema2pojo.version>1.2.1</jsonschema2pojo.version>
|
||||
|
@ -62,6 +63,11 @@
|
|||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||
<version>${openapi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Database -->
|
||||
<dependency>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package eu.ztsh.wymiana.web.model;
|
||||
|
||||
import eu.ztsh.wymiana.validation.ValidExchangeRequest;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Builder;
|
||||
import org.hibernate.validator.constraints.pl.PESEL;
|
||||
|
@ -10,11 +11,11 @@ import java.math.BigDecimal;
|
|||
@Builder
|
||||
@ValidExchangeRequest
|
||||
public record CurrencyExchangeRequest(
|
||||
@PESEL String pesel,
|
||||
@NotNull @PESEL String pesel,
|
||||
@NotNull String from,
|
||||
@NotNull String to,
|
||||
BigDecimal toBuy,
|
||||
BigDecimal toSell
|
||||
@Min(0) BigDecimal toBuy,
|
||||
@Min(0) BigDecimal toSell
|
||||
) {
|
||||
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import java.math.BigDecimal;
|
|||
public record UserCreateRequest(
|
||||
@NotNull String name,
|
||||
@NotNull String surname,
|
||||
@PESEL @Adult String pesel,
|
||||
@Min(0) BigDecimal initial) {
|
||||
@PESEL @Adult @NotNull String pesel,
|
||||
@NotNull @Min(0) BigDecimal initial) {
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue