Skip to content

Commit

Permalink
Merge pull request #4 from adewg/master
Browse files Browse the repository at this point in the history
Merge from ADE-WG
  • Loading branch information
cookeac authored Jun 27, 2019
2 parents 9c3fe3c + c3b8671 commit bce94fd
Show file tree
Hide file tree
Showing 14 changed files with 239 additions and 181 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ This repository contains the ICAR ADE work-in-progress JSON standard.

This page describes the principles driving this standard. If you want to use the ICAR ADE standard in your application, there are tips and
tricks in the [Using the standard](https://github.com/adewg/ICAR/blob/master/Using%20the%20standard.md) file. For a quick start, open the
[exampleUrlScheme.yaml](https://raw.githubusercontent.com/adewg/ICAR/master/Release%20Candidate%20Messages/exampleUrlScheme.yaml) file in
[exampleUrlScheme.json](https://raw.githubusercontent.com/adewg/ICAR/master/Release%20Candidate%20Messages/exampleUrlScheme.json) file in
your favorite OpenAPI Specification editor, or use the following URL to have a preview in the free Redoc tool: [view
exampleUrlScheme.yaml](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/adewg/ICAR/master/Release%20Candidate%20Messages/exampleUrlScheme.yaml)
exampleUrlScheme.json](https://redocly.github.io/redoc/?url=https://raw.githubusercontent.com/adewg/ICAR/master/Release%20Candidate%20Messages/exampleUrlScheme.json)


Approach
Expand Down
58 changes: 32 additions & 26 deletions Release Candidate Messages/exampleErrorResource.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
{
"id": {
"type": "string",
"description": "A unique identifier for this particular occurrence of the problem"
},
"status": {
"type": "integer",
"description": "The HTTP status code applicable to this problem, expressed as a string value",
"format": "int32"
},
"code": {
"type": "string",
"description": "An application-specific error code, expressed as a string value."
},
"title":{
"type": "string",
"description": "A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization."
},
"detail": {
"type": "string",
"description": "A human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized."
},
"meta": {
"type": "object",
"properties": "{}"
},
"description": "A human-readable error message describing what went wrong."
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "A unique identifier for this particular occurrence of the problem"
},
"status": {
"type": "integer",
"description": "The HTTP status code applicable to this problem, expressed as a string value",
"format": "int32"
},
"code": {
"type": "string",
"description": "An application-specific error code, expressed as a string value."
},
"title": {
"type": "string",
"description": "A short, human-readable summary of the problem that SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization."
},
"detail": {
"type": "string",
"description": "A human-readable explanation specific to this occurrence of the problem. Like title, this field’s value can be localized."
},
"meta": {
"type": "object",
"properties": {

}
}
},
"description": "A human-readable error message describing what went wrong."
}

177 changes: 177 additions & 0 deletions Release Candidate Messages/exampleUrlScheme.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
{
"openapi": "3.0.1",
"info": {
"title": "Release Candidate Messages",
"description": "The specifications of messages which are ready for ICAR approval and release",
"version": "1.0",
"contact" : {
"name": "Animal Data Exchange Working Group",
"url": "https://www.icar.org/index.php/technical-bodies/working-groups/animal-data-exchange-wg/",
"email": "[email protected]"
}
},
"servers": [
{
"url": "http://example.com"
}
],
"tags" : [
{
"name" : "release-candidate",
"description" : "approved by the working group, waiting for a test"
}
],
"paths": {
"/locations/{location-scheme}/{location-id}/milking-visits": {
"get": {
"operationId" : "get-milking-visits",
"summary": "Get the data for milking visits",
"description": "# Purpose\nProvides data from visits of animals to a milking parlour\n",
"tags": [ "release-candidate"],
"parameters": [
{
"name": "location-scheme",
"in": "path",
"description": "The scheme id for the location identifier.",
"required": true,
"schema": {
"type": "string",
"enum": [
"nl.ubn",
"de.farmid",
"be.pen"
]
}
},
{
"name": "location-id",
"in": "path",
"description": "The unique identifier for the location.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "start-date-time",
"in": "query",
"description": "The start of the date-time range for the data to get in the request.",
"schema": {
"type": "string",
"format": "date-time"
}
},
{
"name": "end-date-time",
"in": "query",
"description": "The end of the date-time range for the data to get in the request.",
"schema": {
"type": "string",
"format": "date-time"
}
}
],
"responses": {
"201": {
"description": "Successful. The response contains the milking results for the given location",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/icarMilkingVisitsResponse"
}
}
}
},
"default": {
"description": "An error has occured while handling the request. Check the content of the message for the error details.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"errors": {
"type": "array",
"items": {
"$ref": "#/components/schemas/error"
}
}
},
"description": "A default response containing only a list of errors"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"responseErrors": {
"type": "object",
"properties": {
"errors": {
"type": "array",
"items": {
"$ref": "#/components/schemas/error"
}
}
}
},
"responseMetaData": {
"type": "object",
"properties": {
"metaData": {
"$ref": "#/components/schemas/metaData"
}
}
},
"error": {
"type": "object",
"properties": {
"data": {
"$ref": "exampleErrorResource.json"
}
}
},
"metaData": {
"required": [
"source"
],
"type": "object",
"properties": {
"data": {
"$ref": "icarMetaDataResource.json"
}
}
},
"icarMilkingVisitsResponse": {
"type": "array",
"items": {
"$ref": "#/components/schemas/icarMilkingVisitsResponseDataSources"
}
},
"icarMilkingVisitsResponseDataSources": {
"allOf": [
{
"$ref": "#/components/schemas/responseMetaData"
},
{
"$ref": "#/components/schemas/responseErrors"
},
{
"$ref": "#/components/schemas/icarMilkingVisitsResponseDataSource"
}
]
},
"icarMilkingVisitsResponseDataSource": {
"type": "object",
"properties": {
"data": {
"$ref": "icarMilkingVisitResource.json"
}
}
}
}
}
}
105 changes: 0 additions & 105 deletions Release Candidate Messages/exampleUrlScheme.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions Release Candidate Messages/icarAnimalIdSchemeCode.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "string",
"description": "Identifies the used scheme for an animal identification string. nl-v1 life numbers are formatted as NL 123456789. See https://www.rvo.nl/onderwerpen/agrarisch-ondernemen/dieren/dieren-registreren/runderen/oormerken-voor-runderen for more information.",
"enum": [
"nl-v1",
"be-v1"
"nl.ubn",
"be.pen"
]
}
2 changes: 0 additions & 2 deletions Release Candidate Messages/icarEventCoreResource.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",

"required": [
"id",
"animal",
Expand Down
2 changes: 0 additions & 2 deletions Release Candidate Messages/icarIdentifierType.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",

"required": [
"id",
"scheme"
Expand Down
2 changes: 0 additions & 2 deletions Release Candidate Messages/icarLocationIdentifierType.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",

"$ref": "icarIdentifierType.json",
"description": "Location identifier based on a scheme and ID."
}
Loading

0 comments on commit bce94fd

Please sign in to comment.