-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENG-1251] SnapTrade API Portal Feedback (part 2 - ordering endpoints (…
…#263) * cleanup sidebar spacing * add more docs for api portal * normalize line heights/font size for navlinks * style section label better * make radius "sm" for object/array forms in reference page * fix line height of linksgroup.tsx * reduce padding for api reference operations * order + orderOpenApiSpecification * docs(changeset): add "order" property to konfig.yaml for ordering operations in API reference page * orderOpenApiSpecification in api portal * add docs for ordering operations in api reference * add passthrough to KonfigYamlCommon to future compatability
- Loading branch information
Showing
26 changed files
with
554 additions
and
47 deletions.
There are no files selected for viewing
Submodule decentro-in-collections-sdk
updated
from f7ae40 to c67f29
Submodule decentro-in-kyc-sdk
updated
from 360ee9 to f66795
Submodule groundx-sdks
updated
from 1fd834 to a407f2
Submodule newscatcher-sdks
updated
from 150be8 to b82225
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'konfig-lib': minor | ||
--- | ||
|
||
add "order" property to konfig.yaml for ordering operations in API reference page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
148 changes: 148 additions & 0 deletions
148
generator/konfig-dash/packages/konfig-lib/src/util/order-openapi-specification.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
import { Spec } from '../parseSpec' | ||
import { orderOpenApiSpecification } from './order-openapi-specification' | ||
|
||
describe('orderOpenApiSpecification', () => { | ||
it('should order tags and operations based on user configuration', () => { | ||
const spec: Spec['spec'] = { | ||
openapi: '3.0.0', | ||
info: { | ||
title: 'Test', | ||
version: '1.0.0', | ||
}, | ||
paths: { | ||
'/test4': { | ||
get: { | ||
tags: ['test4'], | ||
operationId: 'test4', | ||
responses: {}, | ||
}, | ||
}, | ||
'/test3': { | ||
get: { | ||
tags: ['test3'], | ||
operationId: 'test3', | ||
responses: {}, | ||
}, | ||
}, | ||
'/test': { | ||
get: { | ||
tags: ['test'], | ||
operationId: 'test', | ||
responses: {}, | ||
}, | ||
}, | ||
'/test-x': { | ||
get: { | ||
tags: ['test'], | ||
operationId: 'test-x', | ||
responses: {}, | ||
}, | ||
}, | ||
'/test2': { | ||
get: { | ||
tags: ['test2'], | ||
operationId: 'test2', | ||
responses: {}, | ||
}, | ||
}, | ||
}, | ||
tags: [ | ||
{ | ||
name: 'test2', | ||
}, | ||
{ | ||
name: 'test', | ||
}, | ||
{ | ||
name: 'test4', | ||
}, | ||
{ | ||
name: 'test3', | ||
}, | ||
], | ||
} | ||
|
||
const orderedSpec: Spec['spec'] = { | ||
openapi: '3.0.0', | ||
info: { | ||
title: 'Test', | ||
version: '1.0.0', | ||
}, | ||
paths: { | ||
'/test-x': { | ||
get: { | ||
tags: ['test'], | ||
operationId: 'test-x', | ||
responses: {}, | ||
}, | ||
}, | ||
'/test': { | ||
get: { | ||
tags: ['test'], | ||
operationId: 'test', | ||
responses: {}, | ||
}, | ||
}, | ||
'/test2': { | ||
get: { | ||
tags: ['test2'], | ||
operationId: 'test2', | ||
responses: {}, | ||
}, | ||
}, | ||
'/test4': { | ||
get: { | ||
tags: ['test4'], | ||
operationId: 'test4', | ||
responses: {}, | ||
}, | ||
}, | ||
'/test3': { | ||
get: { | ||
tags: ['test3'], | ||
operationId: 'test3', | ||
responses: {}, | ||
}, | ||
}, | ||
}, | ||
tags: [ | ||
{ | ||
name: 'test', | ||
}, | ||
{ | ||
name: 'test2', | ||
}, | ||
{ | ||
name: 'test4', | ||
}, | ||
{ | ||
name: 'test3', | ||
}, | ||
], | ||
} | ||
|
||
orderOpenApiSpecification({ | ||
spec, | ||
order: [ | ||
{ | ||
tag: 'test', | ||
operations: [ | ||
'test-x', | ||
{ | ||
path: '/test', | ||
method: 'get', | ||
}, | ||
], | ||
}, | ||
{ | ||
tag: 'test2', | ||
}, | ||
], | ||
}) | ||
|
||
expect(spec.tags).toStrictEqual(orderedSpec.tags) | ||
expect(Object.keys(spec.paths)).toStrictEqual( | ||
Object.keys(orderedSpec.paths) | ||
) | ||
}) | ||
}) |
Oops, something went wrong.