We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The typescript-fetch generator defines models with type: string/format: date as type string, but serializes/deserializes the value as a Date
openapi-generator-cli-4.0.0-20181126.024631-44
swagger: "2.0" paths: "/config": get: operationId: "config.get" responses: 200: description: Success schema: $ref: "#/definitions/SiteConfiguration" definitions: SiteConfiguration: description: "Site configuration" type: object properties: maxReportingDate: type: string format: date minReportingDate: type: string format: date
Generated Code (excerpt):
export interface SiteConfiguration { /** * * @type {string} * @memberof SiteConfiguration */ maxReportingDate?: string; /** * * @type {string} * @memberof SiteConfiguration */ minReportingDate?: string; } export function SiteConfigurationFromJSON(json: any): SiteConfiguration { return { 'maxReportingDate': !exists(json, 'maxReportingDate') ? undefined : new Date(json['maxReportingDate']), 'minReportingDate': !exists(json, 'minReportingDate') ? undefined : new Date(json['minReportingDate']), }; }
openapi-generator generate -i openapi.yaml -l typescript-fetch -c es6.json -o ./typescript-api/
PR #569
Add additional resolution for Date or DateTime formatted strings in getTypeDeclaration here
getTypeDeclaration
The text was updated successfully, but these errors were encountered:
cc @Place1
Sorry, something went wrong.
No branches or pull requests
Description
The typescript-fetch generator defines models with type: string/format: date as type string, but serializes/deserializes the value as a Date
openapi-generator version
openapi-generator-cli-4.0.0-20181126.024631-44
OpenAPI declaration file content or url
Generated Code (excerpt):
Command line used for generation
openapi-generator generate -i openapi.yaml -l typescript-fetch -c es6.json -o ./typescript-api/
Steps to reproduce
Related issues/PRs
PR #569
Suggest a fix/enhancement
Add additional resolution for Date or DateTime formatted strings in
getTypeDeclaration
hereThe text was updated successfully, but these errors were encountered: