Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions api-docs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand Down Expand Up @@ -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"
}
}
}
Expand Down Expand Up @@ -8134,4 +8120,4 @@
}
}
}
}
}
14 changes: 2 additions & 12 deletions src/controller/org.controller/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
}
}
}
Expand Down Expand Up @@ -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' }
}
}
}
Expand Down
21 changes: 21 additions & 0 deletions test/unit-tests/org/openapiOrgResponseTest.js
Original file line number Diff line number Diff line change
@@ -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'
})
})
})
Loading