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 -->
|
<!-- dependencies -->
|
||||||
<wiremock.version>3.5.4</wiremock.version>
|
<wiremock.version>3.5.4</wiremock.version>
|
||||||
|
<openapi.version>2.5.0</openapi.version>
|
||||||
|
|
||||||
<!-- plugins -->
|
<!-- plugins -->
|
||||||
<jsonschema2pojo.version>1.2.1</jsonschema2pojo.version>
|
<jsonschema2pojo.version>1.2.1</jsonschema2pojo.version>
|
||||||
|
@ -62,6 +63,11 @@
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
|
||||||
|
<version>${openapi.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Database -->
|
<!-- Database -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package eu.ztsh.wymiana.web.model;
|
package eu.ztsh.wymiana.web.model;
|
||||||
|
|
||||||
import eu.ztsh.wymiana.validation.ValidExchangeRequest;
|
import eu.ztsh.wymiana.validation.ValidExchangeRequest;
|
||||||
|
import jakarta.validation.constraints.Min;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import org.hibernate.validator.constraints.pl.PESEL;
|
import org.hibernate.validator.constraints.pl.PESEL;
|
||||||
|
@ -10,11 +11,11 @@ import java.math.BigDecimal;
|
||||||
@Builder
|
@Builder
|
||||||
@ValidExchangeRequest
|
@ValidExchangeRequest
|
||||||
public record CurrencyExchangeRequest(
|
public record CurrencyExchangeRequest(
|
||||||
@PESEL String pesel,
|
@NotNull @PESEL String pesel,
|
||||||
@NotNull String from,
|
@NotNull String from,
|
||||||
@NotNull String to,
|
@NotNull String to,
|
||||||
BigDecimal toBuy,
|
@Min(0) BigDecimal toBuy,
|
||||||
BigDecimal toSell
|
@Min(0) BigDecimal toSell
|
||||||
) {
|
) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ import java.math.BigDecimal;
|
||||||
public record UserCreateRequest(
|
public record UserCreateRequest(
|
||||||
@NotNull String name,
|
@NotNull String name,
|
||||||
@NotNull String surname,
|
@NotNull String surname,
|
||||||
@PESEL @Adult String pesel,
|
@PESEL @Adult @NotNull String pesel,
|
||||||
@Min(0) BigDecimal initial) {
|
@NotNull @Min(0) BigDecimal initial) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue