Skip to content

Commit

Permalink
wip fix path and description generation in endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
kainpets committed Jul 5, 2024
1 parent 5206387 commit 51942f1
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/lib/blueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ const createEndpoint = (
'operationId' in operation && typeof operation['operationId'] === 'string'
? operation['operationId']
: `${path.replace(/\//g, '')}${method.charAt(0).toUpperCase() + method.slice(1).toLowerCase()}`,
path,
path: `/${path.split('/').slice(1, -1).join('/')}`,
description:
'summary' in operation && typeof operation['summary'] === 'string'
? operation['summary']
: `${method.toUpperCase()} ${path}`,
'description' in operation && typeof operation['description'] === 'string'
? operation['description']
: '',
isUndocumented: false,
isDeprecated: false,
deprecationMessage: '',
Expand Down
2 changes: 1 addition & 1 deletion src/lib/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ export interface Openapi {
}
}
>
}
}
8 changes: 4 additions & 4 deletions test/snapshots/blueprint.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ Generated by [AVA](https://avajs.dev).
endpoints: [
{
deprecationMessage: '',
description: '/foos/get',
description: '',
isDeprecated: false,
isUndocumented: false,
name: 'foosGetGet',
parameters: [],
path: '/foos/get',
path: '/foos',
request: {
methods: [
'GET',
Expand All @@ -59,12 +59,12 @@ Generated by [AVA](https://avajs.dev).
},
{
deprecationMessage: '',
description: '/foos/get',
description: '',
isDeprecated: false,
isUndocumented: false,
name: 'foosGetPost',
parameters: [],
path: '/foos/get',
path: '/foos',
request: {
methods: [
'POST',
Expand Down
Binary file modified test/snapshots/blueprint.test.ts.snap
Binary file not shown.
4 changes: 2 additions & 2 deletions test/snapshots/seam-blueprint.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,12 @@ Generated by [AVA](https://avajs.dev).
endpoints: [
{
deprecationMessage: '',
description: '/acs/systems/list',
description: '',
isDeprecated: false,
isUndocumented: false,
name: 'acsSystemsListPost',
parameters: [],
path: '/acs/systems/list',
path: '/acs/systems',
request: {
methods: [
'POST',
Expand Down
Binary file modified test/snapshots/seam-blueprint.test.ts.snap
Binary file not shown.

0 comments on commit 51942f1

Please sign in to comment.