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

Missing fields on enum #2184

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
28 changes: 28 additions & 0 deletions test/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3703,6 +3703,7 @@ export type { EnumFromDescription } from './models/EnumFromDescription';
export { EnumWithExtensions } from './models/EnumWithExtensions';
export { EnumWithNumbers } from './models/EnumWithNumbers';
export { EnumWithStrings } from './models/EnumWithStrings';
export { EnumWithStringsWithPlusAndMinusSigns } from './models/EnumWithStringsWithPlusAndMinusSigns';
export type { File } from './models/File';
export type { FreeFormObjectWithAdditionalPropertiesEqEmptyObject } from './models/FreeFormObjectWithAdditionalPropertiesEqEmptyObject';
export type { FreeFormObjectWithAdditionalPropertiesEqTrue } from './models/FreeFormObjectWithAdditionalPropertiesEqTrue';
Expand Down Expand Up @@ -3773,6 +3774,7 @@ export { $EnumFromDescription } from './schemas/$EnumFromDescription';
export { $EnumWithExtensions } from './schemas/$EnumWithExtensions';
export { $EnumWithNumbers } from './schemas/$EnumWithNumbers';
export { $EnumWithStrings } from './schemas/$EnumWithStrings';
export { $EnumWithStringsWithPlusAndMinusSigns } from './schemas/$EnumWithStringsWithPlusAndMinusSigns';
export { $File } from './schemas/$File';
export { $FreeFormObjectWithAdditionalPropertiesEqEmptyObject } from './schemas/$FreeFormObjectWithAdditionalPropertiesEqEmptyObject';
export { $FreeFormObjectWithAdditionalPropertiesEqTrue } from './schemas/$FreeFormObjectWithAdditionalPropertiesEqTrue';
Expand Down Expand Up @@ -4389,6 +4391,21 @@ export enum EnumWithStrings {
"
`;

exports[`v3 should generate: test/generated/v3/models/EnumWithStringsWithPlusAndMinusSigns.ts 1`] = `
"/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
/**
* This is a simple enum with strings, but that start with plus and minus signs.
*/
export enum EnumWithStringsWithPlusAndMinusSigns {
_NAME = '+name',
_TOTAL = '+total',
}
"
`;

exports[`v3 should generate: test/generated/v3/models/File.ts 1`] = `
"/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
Expand Down Expand Up @@ -5633,6 +5650,17 @@ export const $EnumWithStrings = {
"
`;

exports[`v3 should generate: test/generated/v3/schemas/$EnumWithStringsWithPlusAndMinusSigns.ts 1`] = `
"/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export const $EnumWithStringsWithPlusAndMinusSigns = {
type: 'Enum',
} as const;
"
`;

exports[`v3 should generate: test/generated/v3/schemas/$File.ts 1`] = `
"/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
Expand Down
9 changes: 9 additions & 0 deletions test/spec/v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -1564,6 +1564,15 @@
"\"Double Quotes\""
]
},
"EnumWithStringsWithPlusAndMinusSigns": {
"description": "This is a simple enum with strings, but that start with plus and minus signs.",
"enum": [
"+name",
"-name",
"+total",
"-total"
]
},
"EnumWithNumbers": {
"description": "This is a simple enum with numbers",
"enum": [
Expand Down