From 817ab4684da12528a37d9dafc298077cba32dcb1 Mon Sep 17 00:00:00 2001 From: ianbrown9475 Date: Fri, 14 Feb 2020 12:48:31 -0800 Subject: [PATCH 01/16] Create openapi from generator, add file operations --- openapi.yaml | 325 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 325 insertions(+) create mode 100644 openapi.yaml diff --git a/openapi.yaml b/openapi.yaml new file mode 100644 index 0000000..95920f3 --- /dev/null +++ b/openapi.yaml @@ -0,0 +1,325 @@ +openapi: 3.0.0 +info: + title: OnBase Documents API + description: API for OnBase documents + version: v1 + license: + name: GNU Affero General Public License Version 3 + url: 'http://www.gnu.org/licenses/agpl-3.0.en.html' + contact: + name: IS Data Architecture Team + url: 'https://is.oregonstate.edu/data-architecture' + email: isdataarchitecture@oregonstate.edu +externalDocs: + description: GitHub Repository + url: TBD +servers: + - url: 'https://api.oregonstate.edu/v1' +security: + - OAuth2: + - full +paths: + /documents: + get: + summary: REPLACEME + tags: + - documents + description: REPLACEME + operationId: getDocuments + responses: + '200': + description: REPLACEME + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentSetResult' + '500': + $ref: '#/components/responses/500' + post: + summary: REPLACEME + tags: + - documents + description: REPLACEME + operationId: postDocument + requestBody: + $ref: '#/components/requestBodies/DocumentPostBody' + responses: + '201': + description: REPLACEME + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentResult' + '409': + $ref: '#/components/responses/409Post' + '500': + $ref: '#/components/responses/500' + '/documents/{id}': + get: + summary: REPLACEME + tags: + - documents + description: REPLACEME + operationId: getDocumentById + parameters: + - $ref: '#/components/parameters/documentId' + responses: + '200': + description: REPLACEME + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentResult' + '404': + $ref: '#/components/responses/404' + '500': + $ref: '#/components/responses/500' + patch: + summary: REPLACEME + tags: + - documents + description: REPLACEME + operationId: patchDocumentById + parameters: + - $ref: '#/components/parameters/documentId' + requestBody: + $ref: '#/components/requestBodies/DocumentPatchBody' + responses: + '200': + description: REPLACEME + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentResult' + '404': + $ref: '#/components/responses/404' + '409': + $ref: '#/components/responses/409Patch' + '500': + $ref: '#/components/responses/500' + '/documents/{id}/file': + get: + summary: REPLACEME + tags: + - documents + description: REPLACEME + operationId: getFileByDocumentId + parameters: + - $ref: '#/components/parameters/documentId' + responses: + '200': + description: REPLACEME + content: + application/octet-stream: + schema: + type: string + format: binary + '404': + $ref: '#/components/responses/404' + '500': + $ref: '#/components/responses/500' + patch: + summary: REPLACEME + tags: + - documents + description: REPLACEME + operationId: patchFileByDocumentId + parameters: + - $ref: '#/components/parameters/documentId' + requestBody: + required: true + content: + application/octet-stream: + schema: + type: string + format: binary + responses: + '204': + description: File successfully uploaded + '404': + $ref: '#/components/responses/404' + '500': + $ref: '#/components/responses/500' +components: + securitySchemes: + OAuth2: + type: oauth2 + flows: + clientCredentials: + tokenUrl: 'https://api.oregonstate.edu/oauth2/token' + scopes: + full: Full access to the API + parameters: + documentId: + name: id + in: path + description: REPLACEME + required: true + schema: + type: string + requestBodies: + DocumentPostBody: + description: REPLACEME + required: true + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/DocumentPostResource' + additionalProperties: false + DocumentPatchBody: + description: REPLACEME + required: true + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/DocumentPatchResource' + additionalProperties: false + responses: + '400': + description: Bad request + content: &ref_0 + application/json: + schema: + $ref: '#/components/schemas/ErrorResult' + '404': + description: Resource not found + content: *ref_0 + '500': + description: Internal server error + content: *ref_0 + 204Delete: + description: The resource was successfully deleted + 204RelationshipUpdate: + description: The relationship(s) already match the requested state + 409Post: + description: >- + The request body resource object's type was invalid or, if a client-generated ID was used, a + resource already exists with this id + content: *ref_0 + 409Patch: + description: >- + The request body resource object had an invalid type, invalid ID, or violated a uniqueness + constraint + content: *ref_0 + schemas: + SelfLink: + type: object + properties: + self: + type: string + format: uri + description: Self-link of current resource + ErrorObject: + type: object + properties: + status: + type: string + description: HTTP status code + example: '123' + title: + type: string + description: 'A short, user readable summary of the error' + example: Not Found + code: + type: string + description: An application-specific error code + example: '1234' + detail: + type: string + description: A long description of the error that may contain instance-specific details + links: + type: object + properties: + about: + type: string + format: uri + description: A link to further information about the error + example: 'https://developer.oregonstate.edu/documentation/error-reference#1234' + ErrorResult: + type: object + properties: + errors: + type: array + items: + $ref: '#/components/schemas/ErrorObject' + DocumentId: + type: string + description: Unique ID of document resource + DocumentType: + type: string + enum: + - document + DocumentAttributes: + type: object + properties: + metaProp: + type: string + description: Meta information TBD + additionalProperties: false + DocumentGetResource: + type: object + properties: + type: + $ref: '#/components/schemas/DocumentType' + id: + $ref: '#/components/schemas/DocumentId' + attributes: + $ref: '#/components/schemas/DocumentAttributes' + links: + $ref: '#/components/schemas/SelfLink' + additionalProperties: false + DocumentPostResource: + type: object + required: + - type + - attributes + properties: + type: + $ref: '#/components/schemas/DocumentType' + attributes: + type: object + allOf: + - type: object + required: + - metaProp + - $ref: '#/components/schemas/DocumentAttributes' + additionalProperties: false + DocumentPatchResource: + type: object + required: + - type + - id + properties: + type: + $ref: '#/components/schemas/DocumentType' + id: + $ref: '#/components/schemas/DocumentId' + attributes: + $ref: '#/components/schemas/DocumentAttributes' + additionalProperties: false + DocumentResult: + type: object + properties: + links: + $ref: '#/components/schemas/SelfLink' + data: + $ref: '#/components/schemas/DocumentGetResource' + DocumentSetResult: + type: object + properties: + links: + $ref: '#/components/schemas/SelfLink' + data: + type: array + items: + $ref: '#/components/schemas/DocumentGetResource' From 68daa26b8c3baf0070153c14da17acff43ad4a01 Mon Sep 17 00:00:00 2001 From: ianbrown9475 Date: Fri, 14 Feb 2020 12:55:16 -0800 Subject: [PATCH 02/16] Modify descriptions --- openapi.yaml | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 95920f3..36ff530 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -21,14 +21,13 @@ security: paths: /documents: get: - summary: REPLACEME + summary: Get documents tags: - documents - description: REPLACEME operationId: getDocuments responses: '200': - description: REPLACEME + description: Successful GET request content: application/json: schema: @@ -36,16 +35,15 @@ paths: '500': $ref: '#/components/responses/500' post: - summary: REPLACEME + summary: Create a new document tags: - documents - description: REPLACEME operationId: postDocument requestBody: $ref: '#/components/requestBodies/DocumentPostBody' responses: '201': - description: REPLACEME + description: Successful creation content: application/json: schema: @@ -56,16 +54,15 @@ paths: $ref: '#/components/responses/500' '/documents/{id}': get: - summary: REPLACEME + summary: Get a single document tags: - documents - description: REPLACEME operationId: getDocumentById parameters: - $ref: '#/components/parameters/documentId' responses: '200': - description: REPLACEME + description: Successful GET request content: application/json: schema: @@ -75,10 +72,9 @@ paths: '500': $ref: '#/components/responses/500' patch: - summary: REPLACEME + summary: Update an existing document tags: - documents - description: REPLACEME operationId: patchDocumentById parameters: - $ref: '#/components/parameters/documentId' @@ -86,7 +82,7 @@ paths: $ref: '#/components/requestBodies/DocumentPatchBody' responses: '200': - description: REPLACEME + description: Successful update content: application/json: schema: @@ -99,16 +95,15 @@ paths: $ref: '#/components/responses/500' '/documents/{id}/file': get: - summary: REPLACEME + summary: Get a document's file tags: - documents - description: REPLACEME operationId: getFileByDocumentId parameters: - $ref: '#/components/parameters/documentId' responses: '200': - description: REPLACEME + description: Successful file request content: application/octet-stream: schema: @@ -118,16 +113,17 @@ paths: $ref: '#/components/responses/404' '500': $ref: '#/components/responses/500' + # TODO: should this be a PUT request instead? patch: - summary: REPLACEME + summary: Update a document's file tags: - documents - description: REPLACEME operationId: patchFileByDocumentId parameters: - $ref: '#/components/parameters/documentId' requestBody: required: true + description: The new file content: application/octet-stream: schema: @@ -153,13 +149,12 @@ components: documentId: name: id in: path - description: REPLACEME + description: The ID of a document required: true schema: type: string requestBodies: DocumentPostBody: - description: REPLACEME required: true content: application/json: @@ -172,7 +167,6 @@ components: $ref: '#/components/schemas/DocumentPostResource' additionalProperties: false DocumentPatchBody: - description: REPLACEME required: true content: application/json: From 2f84f8234ffef227b5cec0cd0bba31449ea4e042 Mon Sep 17 00:00:00 2001 From: ianbrown9475 Date: Fri, 21 Feb 2020 15:07:10 -0800 Subject: [PATCH 03/16] Update openapi with new parameters, multipart form data --- openapi.yaml | 177 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 134 insertions(+), 43 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 36ff530..f40980c 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -25,6 +25,9 @@ paths: tags: - documents operationId: getDocuments + parameters: + - $ref: '#/components/parameters/pageNumber' + - $ref: '#/components/parameters/pageSize' responses: '200': description: Successful GET request @@ -113,29 +116,6 @@ paths: $ref: '#/components/responses/404' '500': $ref: '#/components/responses/500' - # TODO: should this be a PUT request instead? - patch: - summary: Update a document's file - tags: - - documents - operationId: patchFileByDocumentId - parameters: - - $ref: '#/components/parameters/documentId' - requestBody: - required: true - description: The new file - content: - application/octet-stream: - schema: - type: string - format: binary - responses: - '204': - description: File successfully uploaded - '404': - $ref: '#/components/responses/404' - '500': - $ref: '#/components/responses/500' components: securitySchemes: OAuth2: @@ -146,6 +126,25 @@ components: scopes: full: Full access to the API parameters: + pageNumber: + name: 'page[number]' + in: query + required: false + description: Page number of results + schema: + type: integer + minimum: 1 + default: 1 + pageSize: + name: 'page[size]' + in: query + required: false + description: Number of results to return + schema: + type: integer + minimum: 1 + maximum: 500 + default: 25 documentId: name: id in: path @@ -157,27 +156,42 @@ components: DocumentPostBody: required: true content: - application/json: + multipart/form-data: schema: - type: object - required: - - data - properties: - data: - $ref: '#/components/schemas/DocumentPostResource' - additionalProperties: false + allOf: + - type: object + required: + - documentFile + properties: + documentFile: + type: string + format: binary + - type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/DocumentPostResource' + additionalProperties: false DocumentPatchBody: + description: REPLACEME required: true content: - application/json: + multipart/form-data: schema: - type: object - required: - - data - properties: - data: - $ref: '#/components/schemas/DocumentPatchResource' - additionalProperties: false + allOf: + - type: object + properties: + documentFile: + type: string + format: binary + - type: object + required: + - data + properties: + data: + $ref: '#/components/schemas/DocumentPatchResource' + additionalProperties: false responses: '400': description: Bad request @@ -213,6 +227,42 @@ components: type: string format: uri description: Self-link of current resource + Meta: + properties: + totalResults: + type: integer + description: Total number of results + example: 10 + totalPages: + type: integer + description: Total number of pages + example: 10 + currentPageNumber: + type: integer + description: Page number of the returned results + example: 1 + currentPageSize: + type: integer + description: Number of results per page + example: 25 + PaginationLinks: + properties: + first: + type: string + format: uri + description: The first page of data + last: + type: string + format: uri + description: The last page of data + prev: + type: string + format: uri + description: The previous page of data + next: + type: string + format: uri + description: The next page of data ErrorObject: type: object properties: @@ -256,9 +306,36 @@ components: DocumentAttributes: type: object properties: - metaProp: + createdBy: + type: integer + format: int64 + dateStored: + type: string + documentDate: + type: string + documentType: + type: string + status: + type: string + name: type: string - description: Meta information TBD + id: + type: integer + format: int64 + latestAllowedRevisionId: + type: integer + format: int64 + defaultFileType: + type: string + keywords: + type: array + items: + type: object + properties: + name: + type: string + value: + type: string additionalProperties: false DocumentGetResource: type: object @@ -285,7 +362,16 @@ components: allOf: - type: object required: - - metaProp + - createdBy + - dateStored + - documentDate + - documentType + - status + - name + - id + - latestAllowedRevisionId + - defaultFileType + - keywords - $ref: '#/components/schemas/DocumentAttributes' additionalProperties: false DocumentPatchResource: @@ -312,7 +398,12 @@ components: type: object properties: links: - $ref: '#/components/schemas/SelfLink' + type: object + allOf: + - $ref: '#/components/schemas/SelfLink' + - $ref: '#/components/schemas/PaginationLinks' + meta: + $ref: '#/components/schemas/Meta' data: type: array items: From 17468c8cc3746ad6aaaa3d2581830f09af738333 Mon Sep 17 00:00:00 2001 From: David Kalcic Date: Thu, 16 Jul 2020 14:24:41 -0700 Subject: [PATCH 04/16] add query params for GET /locations --- openapi.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index f40980c..ec8a385 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -28,6 +28,24 @@ paths: parameters: - $ref: '#/components/parameters/pageNumber' - $ref: '#/components/parameters/pageSize' + - in: query + name: filter[indexKey] + description: Search documents by index key + required: false + schema: + type: string + - in: query + name: filter[typeGroup] + description: Search documents by type group + required: false + schema: + type: string + - in: query + name: filter[startDocId] + description: Search documents by startDocId + required: false + schema: + type: string responses: '200': description: Successful GET request From 72b598f398164ec09b3d6961aa7607550e469d49 Mon Sep 17 00:00:00 2001 From: Alex Ruef Date: Wed, 12 May 2021 10:18:32 -0700 Subject: [PATCH 05/16] fixed URLS --- openapi.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index ec8a385..9214fd7 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -5,16 +5,16 @@ info: version: v1 license: name: GNU Affero General Public License Version 3 - url: 'http://www.gnu.org/licenses/agpl-3.0.en.html' + url: http://www.gnu.org/licenses/agpl-3.0.en.html contact: name: IS Data Architecture Team - url: 'https://is.oregonstate.edu/data-architecture' + url: https://is.oregonstate.edu/data-architecture email: isdataarchitecture@oregonstate.edu externalDocs: description: GitHub Repository - url: TBD + url: https://github.com/osu-mist/onbase-docs-api servers: - - url: 'https://api.oregonstate.edu/v1' + - url: https://api.oregonstate.edu/v1 security: - OAuth2: - full From 7caf74509603e8d17a713bf7bba94f6917381503 Mon Sep 17 00:00:00 2001 From: Alex Ruef Date: Wed, 12 May 2021 10:18:51 -0700 Subject: [PATCH 06/16] renamed documents endpoint to onbase-docs --- openapi.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 9214fd7..7834fad 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -19,11 +19,11 @@ security: - OAuth2: - full paths: - /documents: + /onbase-docs: get: summary: Get documents tags: - - documents + - onbase-docs operationId: getDocuments parameters: - $ref: '#/components/parameters/pageNumber' @@ -58,7 +58,7 @@ paths: post: summary: Create a new document tags: - - documents + - onbase-docs operationId: postDocument requestBody: $ref: '#/components/requestBodies/DocumentPostBody' @@ -73,11 +73,11 @@ paths: $ref: '#/components/responses/409Post' '500': $ref: '#/components/responses/500' - '/documents/{id}': + /onbase-docs/{id}: get: summary: Get a single document tags: - - documents + - onbase-docs operationId: getDocumentById parameters: - $ref: '#/components/parameters/documentId' @@ -95,7 +95,7 @@ paths: patch: summary: Update an existing document tags: - - documents + - onbase-docs operationId: patchDocumentById parameters: - $ref: '#/components/parameters/documentId' @@ -114,11 +114,11 @@ paths: $ref: '#/components/responses/409Patch' '500': $ref: '#/components/responses/500' - '/documents/{id}/file': + /onbase-docs/{id}/file: get: summary: Get a document's file tags: - - documents + - onbase-docs operationId: getFileByDocumentId parameters: - $ref: '#/components/parameters/documentId' From a9d5d40c33fd0c8021b50eb87586a8d6ddbf6d15 Mon Sep 17 00:00:00 2001 From: Alex Ruef Date: Mon, 17 May 2021 11:05:45 -0700 Subject: [PATCH 07/16] Finished DocumentAttributes --- openapi.yaml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 7834fad..078a0d0 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -327,24 +327,48 @@ components: createdBy: type: integer format: int64 + description: Id of profile which created the document + example: 20048 dateStored: type: string + format: date-time + description: Date this document was uploaded to onbase + example: '2021-04-28T15:59:22+00:00' documentDate: type: string + format: date-time + description: Date associated with the uploaded document + example: '2021-04-28T15:59:22+00:00' documentType: type: string + description: Type associated with the document + example: Test - Test Documents + reindexDocumentType: + type: string + description: Holds the final document type while the document goes through the staging process + example: Test - Test Documents status: type: string + description: status of this document + example: Active name: type: string + description: title of the document + example: 999744823 Brando, Dio, - TEST - Test Documents id: type: integer format: int64 + description: Unique identifier for this document + example: 47779365 latestAllowedRevisionId: type: integer format: int64 + description: Id of profile that last revised the document + example: 20048 defaultFileType: type: string + description: Assumed file type for this document + example: PDF keywords: type: array items: @@ -352,8 +376,10 @@ components: properties: name: type: string + example: DOC - Index Key value: type: string + example: 999999999 additionalProperties: false DocumentGetResource: type: object From f006c385001c38cedd9570fdc7203f1d763fc4ab Mon Sep 17 00:00:00 2001 From: Alex Ruef Date: Mon, 17 May 2021 11:06:39 -0700 Subject: [PATCH 08/16] added 400 error response to base endpoint --- openapi.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openapi.yaml b/openapi.yaml index 078a0d0..2bfdde7 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -53,6 +53,8 @@ paths: application/json: schema: $ref: '#/components/schemas/DocumentSetResult' + '400': + $ref: '#/components/responses/400' '500': $ref: '#/components/responses/500' post: From 41fd163edf0514f52b4fd2241eceafcb17372848 Mon Sep 17 00:00:00 2001 From: Alex Ruef Date: Mon, 17 May 2021 11:07:01 -0700 Subject: [PATCH 09/16] Finished query parameters for get endpoints --- openapi.yaml | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 2bfdde7..359c4a0 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -32,20 +32,38 @@ paths: name: filter[indexKey] description: Search documents by index key required: false + example: 47779366 + schema: + type: integer + - in: query + name: filter[type] + description: Search documents by document type + required: false + example: TEST - Test Documents schema: type: string - in: query name: filter[typeGroup] - description: Search documents by type group + description: Search documents by document type group required: false + example: TEST schema: type: string - in: query name: filter[startDocId] - description: Search documents by startDocId + description: Filter documents by minimum document Id required: false + example: 47779366 + schema: + type: integer + - in: query + name: filter[keywords][hasAll] + description: Filter documents by a list of keywords + required: false + example: DOC - Index Key:999999999|SECKEY - Delete Flag:No schema: type: string + pattern: keyword:value|keyword:value responses: '200': description: Successful GET request @@ -171,7 +189,7 @@ components: description: The ID of a document required: true schema: - type: string + type: integer requestBodies: DocumentPostBody: required: true From 14a7311630102acba3d6a17e412f9e4070f1341e Mon Sep 17 00:00:00 2001 From: Alex Ruef Date: Tue, 18 May 2021 14:45:13 -0700 Subject: [PATCH 10/16] Completed document attributes --- openapi.yaml | 134 ++++++++++++++++++++++++++------------------------- 1 file changed, 68 insertions(+), 66 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 359c4a0..0b0f3a8 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -344,51 +344,10 @@ components: DocumentAttributes: type: object properties: - createdBy: - type: integer - format: int64 - description: Id of profile which created the document - example: 20048 - dateStored: - type: string - format: date-time - description: Date this document was uploaded to onbase - example: '2021-04-28T15:59:22+00:00' - documentDate: - type: string - format: date-time - description: Date associated with the uploaded document - example: '2021-04-28T15:59:22+00:00' documentType: type: string description: Type associated with the document example: Test - Test Documents - reindexDocumentType: - type: string - description: Holds the final document type while the document goes through the staging process - example: Test - Test Documents - status: - type: string - description: status of this document - example: Active - name: - type: string - description: title of the document - example: 999744823 Brando, Dio, - TEST - Test Documents - id: - type: integer - format: int64 - description: Unique identifier for this document - example: 47779365 - latestAllowedRevisionId: - type: integer - format: int64 - description: Id of profile that last revised the document - example: 20048 - defaultFileType: - type: string - description: Assumed file type for this document - example: PDF keywords: type: array items: @@ -400,7 +359,53 @@ components: value: type: string example: 999999999 - additionalProperties: false + DocumentGetAttributes: + allOf: + - $ref: '#/components/schemas/DocumentAttributes' + - type: object + properties: + createdBy: + type: integer + format: int64 + description: Id of profile which created the document + example: 20048 + dateStored: + type: string + format: date-time + description: Date this document was uploaded to onbase + example: '2021-04-28T15:59:22+00:00' + documentDate: + type: string + format: date-time + description: Date associated with the uploaded document + example: '2021-04-28T15:59:22+00:00' + reindexDocumentType: + type: string + description: Holds the final document type while the document goes through the staging process + example: Test - Test Documents + status: + type: string + description: status of this document + example: Active + name: + type: string + description: title of the document + example: 999744823 Brando, Dio, - TEST - Test Documents + id: + type: integer + format: int64 + description: Unique identifier for this document + example: 47779365 + latestAllowedRevisionId: + type: integer + format: int64 + description: Id of profile that last revised the document + example: 20048 + defaultFileType: + type: string + description: Assumed file type for this document + example: PDF + additionalProperties: false DocumentGetResource: type: object properties: @@ -409,35 +414,32 @@ components: id: $ref: '#/components/schemas/DocumentId' attributes: - $ref: '#/components/schemas/DocumentAttributes' + $ref: '#/components/schemas/DocumentGetAttributes' links: $ref: '#/components/schemas/SelfLink' additionalProperties: false DocumentPostResource: - type: object required: - - type - - attributes - properties: - type: - $ref: '#/components/schemas/DocumentType' - attributes: - type: object - allOf: - - type: object - required: - - createdBy - - dateStored - - documentDate - - documentType - - status - - name - - id - - latestAllowedRevisionId - - defaultFileType - - keywords - - $ref: '#/components/schemas/DocumentAttributes' - additionalProperties: false + - DocumentType + - comment + - indexKey + allOf: + - $ref: '#/components/schemas/DocumentAttributes' + - type: object + properties: + fileType: + type: string + description: type of file being uploaded + example: PDF + comment: + type: string + description: Message associated with file upload + example: Test pdf comment + indexKey: + type: string + description: OSU Id associated with this file + example: 999999999 + additionalProperties: false DocumentPatchResource: type: object required: From af96d5d90b23fee0bb5f83952b71acb664577e1b Mon Sep 17 00:00:00 2001 From: Alex Ruef Date: Tue, 18 May 2021 14:45:26 -0700 Subject: [PATCH 11/16] finished post body --- openapi.yaml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 0b0f3a8..00bb31e 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -196,21 +196,17 @@ components: content: multipart/form-data: schema: - allOf: - - type: object - required: - - documentFile - properties: - documentFile: - type: string - format: binary - - type: object - required: - - data - properties: - data: - $ref: '#/components/schemas/DocumentPostResource' - additionalProperties: false + type: object + required: + - attributes + - file + properties: + attributes: + $ref: '#/components/schemas/DocumentPostResource' + file: + type: string + format: binary + additionalProperties: false DocumentPatchBody: description: REPLACEME required: true From 42c278be88bdfef4aaf264601850b89f35e1e7e3 Mon Sep 17 00:00:00 2001 From: Alex Ruef Date: Tue, 18 May 2021 14:46:46 -0700 Subject: [PATCH 12/16] Added example for documentId in path --- openapi.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/openapi.yaml b/openapi.yaml index 00bb31e..8f442f1 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -187,6 +187,7 @@ components: name: id in: path description: The ID of a document + example: 999999999 required: true schema: type: integer From 1217cafa57bb9d54bc37fc113851f95ca766431a Mon Sep 17 00:00:00 2001 From: Alex Ruef Date: Tue, 18 May 2021 15:13:17 -0700 Subject: [PATCH 13/16] remove patch endpoint that does not exist --- openapi.yaml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 8f442f1..2793c07 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -112,28 +112,6 @@ paths: $ref: '#/components/responses/404' '500': $ref: '#/components/responses/500' - patch: - summary: Update an existing document - tags: - - onbase-docs - operationId: patchDocumentById - parameters: - - $ref: '#/components/parameters/documentId' - requestBody: - $ref: '#/components/requestBodies/DocumentPatchBody' - responses: - '200': - description: Successful update - content: - application/json: - schema: - $ref: '#/components/schemas/DocumentResult' - '404': - $ref: '#/components/responses/404' - '409': - $ref: '#/components/responses/409Patch' - '500': - $ref: '#/components/responses/500' /onbase-docs/{id}/file: get: summary: Get a document's file From 1a408151c8ca5afb21f835b586f97fc52bec671d Mon Sep 17 00:00:00 2001 From: Alex Ruef Date: Tue, 18 May 2021 15:13:31 -0700 Subject: [PATCH 14/16] corrected DocumentType enum --- openapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.yaml b/openapi.yaml index 2793c07..bc3cadb 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -315,7 +315,7 @@ components: DocumentType: type: string enum: - - document + - onbaseDocument DocumentAttributes: type: object properties: From dfd6f9ce3964253ba74e19dd5fb57a3a39dc8051 Mon Sep 17 00:00:00 2001 From: Alex Ruef Date: Tue, 18 May 2021 15:13:49 -0700 Subject: [PATCH 15/16] removed pagination and meta fields --- openapi.yaml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index bc3cadb..57143d1 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -26,8 +26,6 @@ paths: - onbase-docs operationId: getDocuments parameters: - - $ref: '#/components/parameters/pageNumber' - - $ref: '#/components/parameters/pageSize' - in: query name: filter[indexKey] description: Search documents by index key @@ -439,12 +437,7 @@ components: type: object properties: links: - type: object - allOf: - - $ref: '#/components/schemas/SelfLink' - - $ref: '#/components/schemas/PaginationLinks' - meta: - $ref: '#/components/schemas/Meta' + $ref: '#/components/schemas/SelfLink' data: type: array items: From 0c860ae17cb0ea228ab3eb270101b2b30897fbb0 Mon Sep 17 00:00:00 2001 From: Alex Ruef Date: Tue, 18 May 2021 15:14:04 -0700 Subject: [PATCH 16/16] corrected order of values in DocumentGetResource --- openapi.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi.yaml b/openapi.yaml index 57143d1..487230b 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -382,10 +382,10 @@ components: DocumentGetResource: type: object properties: - type: - $ref: '#/components/schemas/DocumentType' id: $ref: '#/components/schemas/DocumentId' + type: + $ref: '#/components/schemas/DocumentType' attributes: $ref: '#/components/schemas/DocumentGetAttributes' links: