Skip to content

Commit

Permalink
feat: Generate all endpoints under /acs/systems route (#55)
Browse files Browse the repository at this point in the history
* Generate all endpoints under /acs/systems route

* Update test snapshot

* ci: Generate code

---------

Co-authored-by: Seam Bot <[email protected]>
  • Loading branch information
andrii-balitskyi and seambot authored Aug 7, 2024
1 parent 360813c commit 6b22e0b
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/blueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export const createBlueprint = (typesModule: TypesModuleInput): Blueprint => {
const openapi = typesModule.openapi as Openapi

const isFakeData = openapi.info.title === 'Foo'
const targetPath = '/acs/systems/list'
const targetPath = '/acs/systems/'
const targetSchema = 'acs_system'

const context = {
Expand All @@ -205,7 +205,7 @@ const createRoutes = (
context: Context,
): Route[] => {
return Object.entries(paths)
.filter(([path]) => isFakeData || path === targetPath)
.filter(([path]) => isFakeData || path.startsWith(targetPath))
.map(([path, pathItem]) => createRoute(path, pathItem, context))
}

Expand Down
84 changes: 84 additions & 0 deletions test/snapshots/seam-blueprint.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,48 @@ Generated by [AVA](https://avajs.dev).
},
},
routes: [
{
endpoints: [
{
codeSamples: [],
deprecationMessage: '',
description: '',
isDeprecated: false,
isUndocumented: false,
parameters: [],
path: '/acs/systems/get',
request: {
methods: [
'POST',
],
parameters: [
{
deprecationMessage: '',
description: '',
format: 'uuid',
isDeprecated: false,
isRequired: true,
isUndocumented: false,
name: 'acs_system_id',
type: 'string',
},
],
preferredMethod: 'POST',
semanticMethod: 'POST',
},
response: {
description: 'OK',
responseType: 'void',
},
title: '',
},
],
namespace: {
path: '/acs',
},
path: '/acs/systems',
subroutes: [],
},
{
endpoints: [
{
Expand Down Expand Up @@ -279,6 +321,48 @@ Generated by [AVA](https://avajs.dev).
path: '/acs/systems',
subroutes: [],
},
{
endpoints: [
{
codeSamples: [],
deprecationMessage: '',
description: '',
isDeprecated: false,
isUndocumented: false,
parameters: [],
path: '/acs/systems/list_compatible_credential_manager_acs_systems',
request: {
methods: [
'POST',
],
parameters: [
{
deprecationMessage: '',
description: '',
format: 'uuid',
isDeprecated: false,
isRequired: true,
isUndocumented: false,
name: 'acs_system_id',
type: 'string',
},
],
preferredMethod: 'POST',
semanticMethod: 'POST',
},
response: {
description: 'OK',
responseType: 'void',
},
title: '',
},
],
namespace: {
path: '/acs',
},
path: '/acs/systems',
subroutes: [],
},
],
title: 'Seam Connect',
}
Binary file modified test/snapshots/seam-blueprint.test.ts.snap
Binary file not shown.

0 comments on commit 6b22e0b

Please sign in to comment.