Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove "_" from types #636

Merged
merged 1 commit into from
Apr 12, 2022
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
2 changes: 1 addition & 1 deletion packages/core/__tests__/normalizeVisitors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('Normalize visitors', () => {
expect(normalized.PathItem.enter).toHaveLength(1);
expect(normalized.Operation.enter).toHaveLength(1);
expect(normalized.Parameter.enter).toHaveLength(1);
expect(normalized.Parameter_List.enter).toHaveLength(2);
expect(normalized.ParameterList.enter).toHaveLength(2);
});

it('should order deeper visitors first', () => {
Expand Down
12 changes: 6 additions & 6 deletions packages/core/__tests__/walk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1057,12 +1057,12 @@ describe('walk order', () => {
"enter DefinitionRoot",
"enter PathMap",
"enter PathItem",
"enter Parameter_List",
"enter ParameterList",
"enter Parameter",
"leave Parameter",
"leave Parameter_List",
"leave ParameterList",
"enter Operation",
"enter Parameter_List",
"enter ParameterList",
"enter ref #/components/parameters/shared_a",
"enter Parameter",
"leave Parameter",
Expand All @@ -1071,7 +1071,7 @@ describe('walk order', () => {
"leave Parameter",
"enter Parameter",
"leave Parameter",
"leave Parameter_List",
"leave ParameterList",
"leave Operation",
"leave PathItem",
"leave PathMap",
Expand Down Expand Up @@ -1404,10 +1404,10 @@ describe('type extensions', () => {
"enter DefinitionRoot",
"enter XWebHooks",
"enter hook test",
"enter Parameter_List",
"enter ParameterList",
"enter Parameter",
"leave Parameter",
"leave Parameter_List",
"leave ParameterList",
"leave hook test",
"leave XWebHooks",
"leave DefinitionRoot",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ describe('OpenAPI Schema', () => {
Array [
Object {
"location": "#/servers",
"message": "Expected type \`Server_List\` (array) but got \`object\`",
"message": "Expected type \`ServerList\` (array) but got \`object\`",
},
]
`);
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ type NormalizedResolveTypeFn = (

export function listOf(typeName: string) {
return {
name: typeName + '_List',
name: `${typeName}List`,
properties: {},
items: typeName,
};
}

export function mapOf(typeName: string) {
return {
name: typeName + '_Map',
name: `${typeName}Map`,
properties: {},
additionalProperties: () => typeName,
};
Expand Down