diff --git a/README.md b/README.md index d7ae0595..f8e940ea 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ order. | API | Type | Version | |---|---|---| -| [Data Node](/openapi/data-node) | Data Node | 0.1.1 | -| [Date Annotator](/openapi/date-annotator) | NLP Tool | 0.1.1 | -| [Person Name Annotator](/openapi/person-name-annotator) | NLP Tool | 0.1.1 | -| [Physical Address Annotator](/openapi/physical-address-annotator) | NLP Tool | 0.1.1 | +| [Data Node](/openapi/data-node) | Data Node | 0.1.2 | +| [Date Annotator](/openapi/date-annotator) | NLP Tool | 0.1.2 | +| [Person Name Annotator](/openapi/person-name-annotator) | NLP Tool | 0.1.2 | +| [Physical Address Annotator](/openapi/physical-address-annotator) | NLP Tool | 0.1.2 | ## Web services diff --git a/openapi/commons/components/responses/BadRequest.yaml b/openapi/commons/components/responses/BadRequest.yaml new file mode 100644 index 00000000..01c8e5b2 --- /dev/null +++ b/openapi/commons/components/responses/BadRequest.yaml @@ -0,0 +1,5 @@ +description: Invalid request +content: + application/json: + schema: + $ref: ../schemas/Error.yaml \ No newline at end of file diff --git a/openapi/commons/components/responses/NotFound.yaml b/openapi/commons/components/responses/NotFound.yaml new file mode 100644 index 00000000..b0418d6e --- /dev/null +++ b/openapi/commons/components/responses/NotFound.yaml @@ -0,0 +1,5 @@ +description: The specified resource was not found +content: + application/json: + schema: + $ref: ../schemas/Error.yaml \ No newline at end of file diff --git a/openapi/commons/components/responses/Unauthorized.yaml b/openapi/commons/components/responses/Unauthorized.yaml new file mode 100644 index 00000000..4fb2b624 --- /dev/null +++ b/openapi/commons/components/responses/Unauthorized.yaml @@ -0,0 +1,5 @@ +description: Unauthorized +content: + application/json: + schema: + $ref: ../schemas/Error.yaml \ No newline at end of file diff --git a/openapi/commons/components/schemas/DateAnnotation.yaml b/openapi/commons/components/schemas/DateAnnotation.yaml index 2205316f..220b69ba 100644 --- a/openapi/commons/components/schemas/DateAnnotation.yaml +++ b/openapi/commons/components/schemas/DateAnnotation.yaml @@ -1,7 +1,7 @@ type: object description: A date annotation in a text properties: - dateFormat: + format: description: Date format (ISO 8601) type: string allOf: diff --git a/openapi/commons/components/schemas/Error.yaml b/openapi/commons/components/schemas/Error.yaml new file mode 100644 index 00000000..9d0d0761 --- /dev/null +++ b/openapi/commons/components/schemas/Error.yaml @@ -0,0 +1,9 @@ +type: object +properties: + code: + type: string + message: + type: string +required: + - code + - message \ No newline at end of file diff --git a/openapi/commons/components/schemas/Note.yaml b/openapi/commons/components/schemas/Note.yaml index 21be8a49..80d418ab 100644 --- a/openapi/commons/components/schemas/Note.yaml +++ b/openapi/commons/components/schemas/Note.yaml @@ -4,15 +4,11 @@ properties: text: description: The content of the note type: string - example: October 3, Ms Chloe Price met with... + example: On March 11, Ms Chloe Price met with her family. patientPublicId: - readOnly: true + # readOnly: true allOf: - $ref: PatientPublicId.yaml - filename: - description: The filename of the source note - type: string - example: 260-01.xml type: description: The note type type: string diff --git a/openapi/commons/paths/health.yaml b/openapi/commons/paths/health.yaml index a04955f1..424ab359 100644 --- a/openapi/commons/paths/health.yaml +++ b/openapi/commons/paths/health.yaml @@ -12,6 +12,6 @@ get: schema: $ref: ../components/schemas/Health.yaml '403': - description: Forbidden + $ref: ../components/responses/Unauthorized.yaml '404': - description: Note not found \ No newline at end of file + $ref: ../components/responses/NotFound.yaml \ No newline at end of file diff --git a/openapi/data-node/openapi.yaml b/openapi/data-node/openapi.yaml index 19b2633a..80fb80c6 100644 --- a/openapi/data-node/openapi.yaml +++ b/openapi/data-node/openapi.yaml @@ -1,6 +1,6 @@ openapi: 3.0.2 info: - version: 0.1.1 + version: 0.1.2 title: NLP Sandbox Data Node API contact: name: The NLP Sandbox Team diff --git a/openapi/data-node/paths/annotations/dates.yaml b/openapi/data-node/paths/annotations/dates.yaml index f5a04860..d89b4c3e 100644 --- a/openapi/data-node/paths/annotations/dates.yaml +++ b/openapi/data-node/paths/annotations/dates.yaml @@ -14,7 +14,7 @@ get: default: 10 minimum: 10 responses: - "200": + '200': content: application/json: schema: @@ -22,11 +22,11 @@ get: properties: items: type: array - $ref: '../../../commons/components/schemas/DateAnnotation.yaml' + $ref: ../../../commons/components/schemas/DateAnnotation.yaml allOf: - - $ref: '../../../commons/components/schemas/PageResponse.yaml' + - $ref: ../../../commons/components/schemas/PageResponse.yaml description: Success - "403": - description: Forbidden - "404": - description: Date not found \ No newline at end of file + '403': + $ref: ../../../commons/components/responses/Unauthorized.yaml + '404': + $ref: ../../../commons/components/responses/NotFound.yaml \ No newline at end of file diff --git a/openapi/data-node/paths/notes.yaml b/openapi/data-node/paths/notes.yaml index 2b8986d6..563f2236 100644 --- a/openapi/data-node/paths/notes.yaml +++ b/openapi/data-node/paths/notes.yaml @@ -14,7 +14,7 @@ get: default: 10 minimum: 10 responses: - "200": + '200': content: application/json: schema: @@ -22,12 +22,12 @@ get: properties: items: type: array - $ref: '../../commons/components/schemas/Note.yaml' + $ref: ../../commons/components/schemas/Note.yaml allOf: - - $ref: '../../commons/components/schemas/PageResponse.yaml' + - $ref: ../../commons/components/schemas/PageResponse.yaml description: Success - "403": - description: Forbidden - "404": - description: Note not found + '403': + $ref: ../../commons/components/responses/Unauthorized.yaml + '404': + $ref: ../../commons/components/responses/NotFound.yaml diff --git a/openapi/data-node/paths/notes@{id}.yaml b/openapi/data-node/paths/notes@{id}.yaml index 2cd1a7d3..26eaf834 100644 --- a/openapi/data-node/paths/notes@{id}.yaml +++ b/openapi/data-node/paths/notes@{id}.yaml @@ -19,9 +19,9 @@ get: schema: $ref: ../../commons/components/schemas/Note.yaml '403': - description: Forbidden + $ref: ../../commons/components/responses/Unauthorized.yaml '404': - description: Note not found + $ref: ../../commons/components/responses/NotFound.yaml put: tags: - Note @@ -42,9 +42,9 @@ put: '200': description: OK '400': - description: Invalid note supplied + $ref: ../../commons/components/responses/BadRequest.yaml '404': - description: Note not found + $ref: ../../commons/components/responses/NotFound.yaml requestBody: content: application/json: diff --git a/openapi/date-annotator/openapi.yaml b/openapi/date-annotator/openapi.yaml index f6cb159d..407aece9 100644 --- a/openapi/date-annotator/openapi.yaml +++ b/openapi/date-annotator/openapi.yaml @@ -1,6 +1,6 @@ openapi: 3.0.2 info: - version: 0.1.1 + version: 0.1.2 title: NLP Sandbox Date Annotator API contact: name: The NLP Sandbox Team diff --git a/openapi/date-annotator/paths/dates.yaml b/openapi/date-annotator/paths/dates.yaml index 581c65a6..72eec0e5 100644 --- a/openapi/date-annotator/paths/dates.yaml +++ b/openapi/date-annotator/paths/dates.yaml @@ -14,7 +14,7 @@ get: items: $ref: ../../commons/components/schemas/DateAnnotation.yaml '403': - description: Forbidden + $ref: ../../commons/components/responses/Unauthorized.yaml requestBody: content: application/json: diff --git a/openapi/person-name-annotator/openapi.yaml b/openapi/person-name-annotator/openapi.yaml index e86afc49..f66bc575 100644 --- a/openapi/person-name-annotator/openapi.yaml +++ b/openapi/person-name-annotator/openapi.yaml @@ -1,6 +1,6 @@ openapi: 3.0.2 info: - version: 0.1.1 + version: 0.1.2 title: NLP Sandbox Person Name Annotator API contact: name: The NLP Sandbox Team diff --git a/openapi/physical-address-annotator/openapi.yaml b/openapi/physical-address-annotator/openapi.yaml index 7317386d..5d8ab713 100644 --- a/openapi/physical-address-annotator/openapi.yaml +++ b/openapi/physical-address-annotator/openapi.yaml @@ -1,6 +1,6 @@ openapi: 3.0.2 info: - version: 0.1.1 + version: 0.1.2 title: NLP Sandbox Physical Address Annotator API contact: name: The NLP Sandbox Team diff --git a/package-lock.json b/package-lock.json index a89959dd..9e4a2ede 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nlp-sandbox-schemas", - "version": "1.0.0", + "version": "0.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d2f0582b..a0d28e0e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nlp-sandbox-schemas", - "version": "0.1.1", + "version": "0.1.2", "license": "Apache-2.0", "repository": "github:Sage-Bionetworks/nlp-sandbox-schemas", "devDependencies": {