diff --git a/pom.xml b/pom.xml index 451cc5b..40be7ee 100644 --- a/pom.xml +++ b/pom.xml @@ -30,6 +30,7 @@ + 1.2.1 @@ -66,6 +67,24 @@ org.springframework.boot spring-boot-maven-plugin + + org.jsonschema2pojo + jsonschema2pojo-maven-plugin + ${jsonschema2pojo.version} + + ${basedir}/schema + eu.ztsh.lfr.model + true + false + + + + + generate + + + + diff --git a/readme.md b/readme.md index 3a00ce1..0d417ee 100644 --- a/readme.md +++ b/readme.md @@ -13,7 +13,13 @@ Write an application that, at the endpoint specified by you, returns the yearly [example_file.csv](example_file.csv) -## Example response +## Response + +### Schema +[response_schema](schema/response.json) + +### Example + ```json [ { diff --git a/schema/response.json b/schema/response.json new file mode 100644 index 0000000..335cfe1 --- /dev/null +++ b/schema/response.json @@ -0,0 +1,25 @@ +{ + "$id": "https://ztsh.eu/lfr/response.json", + "$schema": "http://json-schema.org/draft/2020-12/schema", + "type": "array", + "def": { + "entry": { + "type": "object", + "properties": { + "year": { + "type": "string" + }, + "averageTemperature": { + "type": "number" + } + }, + "required": [ + "year", + "averageTemperature" + ] + } + }, + "items": { + "$ref": "#/def/entry" + } +}