From e2b4bd5b8585d69cd0f940a98d1e3aa7e047e85e Mon Sep 17 00:00:00 2001 From: Leo Williamson Date: Wed, 29 Jul 2026 14:10:40 -0400 Subject: [PATCH] Document legacy organization responses --- api-docs/openapi.json | 20 +++--------------- src/controller/org.controller/index.js | 14 ++----------- test/unit-tests/org/openapiOrgResponseTest.js | 21 +++++++++++++++++++ 3 files changed, 26 insertions(+), 29 deletions(-) create mode 100644 test/unit-tests/org/openapiOrgResponseTest.js diff --git a/api-docs/openapi.json b/api-docs/openapi.json index efd583b28..77108a572 100644 --- a/api-docs/openapi.json +++ b/api-docs/openapi.json @@ -1921,14 +1921,7 @@ "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "../schemas/org/list-orgs-response.json" - }, - { - "$ref": "../schemas/registry-org/list-registry-orgs-response.json" - } - ] + "$ref": "../schemas/org/list-orgs-response.json" } } } @@ -2009,14 +2002,7 @@ "content": { "application/json": { "schema": { - "oneOf": [ - { - "$ref": "../schemas/org/create-org-response.json" - }, - { - "$ref": "../schemas/registry-org/create-registry-org-response.json" - } - ] + "$ref": "../schemas/org/create-org-response.json" } } } @@ -7922,4 +7908,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/controller/org.controller/index.js b/src/controller/org.controller/index.js index 52e4c4c77..c2c353917 100644 --- a/src/controller/org.controller/index.js +++ b/src/controller/org.controller/index.js @@ -30,12 +30,7 @@ router.get('/org', description: 'Returns information about all organizations, along with pagination fields if results span multiple pages of data', content: { "application/json": { - schema: { - oneOf: [ - { $ref: '../schemas/org/list-orgs-response.json' }, - { $ref: '../schemas/registry-org/list-registry-orgs-response.json' } - ] - } + schema: { $ref: '../schemas/org/list-orgs-response.json' } } } } @@ -118,12 +113,7 @@ router.post( description: 'Returns information about the organization created', content: { "application/json": { - schema: { - oneOf: [ - { $ref: '../schemas/org/create-org-response.json' }, - { $ref: '../schemas/registry-org/create-registry-org-response.json' } - ] - } + schema: { $ref: '../schemas/org/create-org-response.json' } } } } diff --git a/test/unit-tests/org/openapiOrgResponseTest.js b/test/unit-tests/org/openapiOrgResponseTest.js new file mode 100644 index 000000000..63be2b86a --- /dev/null +++ b/test/unit-tests/org/openapiOrgResponseTest.js @@ -0,0 +1,21 @@ +const chai = require('chai') +const expect = chai.expect +const openapi = require('../../../api-docs/openapi.json') + +describe('Organization OpenAPI response schemas', () => { + it('documents GET /org with only the legacy organization list response', () => { + const schema = openapi.paths['/org'].get.responses['200'].content['application/json'].schema + + expect(schema).to.deep.equal({ + $ref: '../schemas/org/list-orgs-response.json' + }) + }) + + it('documents POST /org with only the legacy organization create response', () => { + const schema = openapi.paths['/org'].post.responses['200'].content['application/json'].schema + + expect(schema).to.deep.equal({ + $ref: '../schemas/org/create-org-response.json' + }) + }) +})