test: NBP rates model
This commit is contained in:
parent
b5237c49bc
commit
d6e9136a68
3 changed files with 71 additions and 1 deletions
|
@ -6,5 +6,5 @@ indent_size = 4
|
|||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.yaml]
|
||||
[{*.yaml,*.json}]
|
||||
indent_size = 2
|
||||
|
|
17
pom.xml
17
pom.xml
|
@ -29,6 +29,7 @@
|
|||
<!-- dependencies -->
|
||||
|
||||
<!-- plugins -->
|
||||
<jsonschema2pojo.version>1.2.1</jsonschema2pojo.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
@ -85,6 +86,22 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jsonschema2pojo</groupId>
|
||||
<artifactId>jsonschema2pojo-maven-plugin</artifactId>
|
||||
<version>${jsonschema2pojo.version}</version>
|
||||
<configuration>
|
||||
<sourceDirectory>${basedir}/src/main/resources/schema</sourceDirectory>
|
||||
<targetPackage>eu.ztsh.wymiana.model</targetPackage>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
|
53
src/main/resources/schema/rates.json
Normal file
53
src/main/resources/schema/rates.json
Normal file
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
"$id": "https://api.nbp.pl/c/rates.json",
|
||||
"$schema": "http://json-schema.org/draft/2020-12/schema",
|
||||
"type": "object",
|
||||
"def": {
|
||||
"rate": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"no": {
|
||||
"type": "string"
|
||||
},
|
||||
"effectiveDate": {
|
||||
"type": "string"
|
||||
},
|
||||
"bid": {
|
||||
"type": "number"
|
||||
},
|
||||
"ask": {
|
||||
"type": "number"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"no",
|
||||
"effectiveDate",
|
||||
"bid",
|
||||
"ask"
|
||||
]
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"table": {
|
||||
"type": "string"
|
||||
},
|
||||
"currency": {
|
||||
"type": "string"
|
||||
},
|
||||
"code": {
|
||||
"type": "string"
|
||||
},
|
||||
"rates": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/def/rate"
|
||||
}
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"table",
|
||||
"currency",
|
||||
"code",
|
||||
"rates"
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue