fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #1687 from hunshcn/fix/plus

fix: sanitize "+" in uri

authored by

Lubos and committed by
GitHub
1de7641b 1df55ede

+7 -2
+5
.changeset/young-parents-float.md
··· 1 + --- 2 + '@hey-api/openapi-ts': patch 3 + --- 4 + 5 + sanitize "+" in uri to avoid plus in function name
+1 -1
packages/openapi-ts/src/openApi/common/parser/__tests__/sanitize.test.ts
··· 27 27 { expected: 'æbc', input: 'æbc' }, 28 28 { expected: 'æb-c', input: 'æb.c' }, 29 29 { expected: 'æb-c', input: '1æb.c' }, 30 - { expected: 'a-b-c--d--e', input: 'a/b{c}/d/$e' }, 30 + { expected: 'a-b-c--d---e', input: 'a/b{c}/d/$+e' }, 31 31 ])( 32 32 'sanitizeNamespaceIdentifier($input) -> $expected', 33 33 ({ expected, input }) => {
+1 -1
packages/openapi-ts/src/openApi/common/parser/sanitize.ts
··· 27 27 name 28 28 .replace(/^[^\p{ID_Start}]+/u, '') 29 29 .replace(/[^$\u200c\u200d\p{ID_Continue}]/gu, '-') 30 - .replace(/\$/g, '-'); 30 + .replace(/[$+]/g, '-'); 31 31 32 32 export const sanitizeOperationParameterName = (name: string) => { 33 33 const withoutBrackets = name.replace('[]', 'Array');