Skip to content

Commit

Permalink
Another example
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-chaulet committed Feb 1, 2024
1 parent 7eb045c commit 7ebe284
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 3 deletions.
43 changes: 40 additions & 3 deletions test/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3692,6 +3692,7 @@ export type { OpenAPIConfig } from './core/OpenAPI';
export type { _default } from './models/_default';
export type { AnyOfAnyAndNull } from './models/AnyOfAnyAndNull';
export type { AnyOfArrays } from './models/AnyOfArrays';
export type { AnyOfArrys } from './models/AnyOfArrys';
export type { ArrayWithAnyOfProperties } from './models/ArrayWithAnyOfProperties';
export type { ArrayWithArray } from './models/ArrayWithArray';
export type { ArrayWithBooleans } from './models/ArrayWithBooleans';
Expand Down Expand Up @@ -3770,6 +3771,7 @@ export type { SimpleStringWithPattern } from './models/SimpleStringWithPattern';
export { $_default } from './schemas/$_default';
export { $AnyOfAnyAndNull } from './schemas/$AnyOfAnyAndNull';
export { $AnyOfArrays } from './schemas/$AnyOfArrays';
export { $AnyOfArrys } from './schemas/$AnyOfArrys';
export { $ArrayWithAnyOfProperties } from './schemas/$ArrayWithAnyOfProperties';
export { $ArrayWithArray } from './schemas/$ArrayWithArray';
export { $ArrayWithBooleans } from './schemas/$ArrayWithBooleans';
Expand Down Expand Up @@ -3912,6 +3914,18 @@ export type AnyOfArrays = {
"
`;

exports[`v3 should generate: test/generated/v3/models/AnyOfArrys.ts 1`] = `
"/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type AnyOfArrys = {
anyarray?: Array<(string | boolean)> | null;
};

"
`;

exports[`v3 should generate: test/generated/v3/models/ArrayWithAnyOfProperties.ts 1`] = `
"/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
Expand Down Expand Up @@ -4565,9 +4579,7 @@ exports[`v3 should generate: test/generated/v3/models/FreeFormObjectWithAddition
/**
* This is a free-form object with additionalProperties: true.
*/
export type FreeFormObjectWithAdditionalPropertiesEqTrue = {
foo?: string;
} & Record<string, any>;
export type FreeFormObjectWithAdditionalPropertiesEqTrue = Record<string, any>;
"
`;

Expand Down Expand Up @@ -5181,6 +5193,31 @@ export const $AnyOfArrays = {
"
`;

exports[`v3 should generate: test/generated/v3/schemas/$AnyOfArrys.ts 1`] = `
"/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export const $AnyOfArrys = {
properties: {
anyarray: {
type: 'any-of',
contains: [{
type: 'any-of',
contains: [{
type: 'string',
}, {
type: 'boolean',
}],
}, {
type: 'null',
}],
},
},
} as const;
"
`;

exports[`v3 should generate: test/generated/v3/schemas/$ArrayWithAnyOfProperties.ts 1`] = `
"/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
Expand Down
25 changes: 25 additions & 0 deletions test/spec/v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2741,6 +2741,31 @@
"const": "Some string"
}
}
},
"AnyOfArrys": {
"properties": {
"anyarray": {
"anyOf": [
{
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "boolean"
}
]
},
"type": "array"
},
{
"type": "null"
}
]
}
},
"type": "object"
}
}
}
Expand Down

0 comments on commit 7ebe284

Please sign in to comment.