Hey,
when generating a parameter with the format 'date', it is falsely converted to 'date-time'. So in my case 'dateFrom' contains a time (e.g. '2019-12-10T17:56:56.999Z'), but should look like this: '2019-12-10'.
4.2.2
...
- name: date_from
in: query
description: >-
Date parameter to search for ... (format\: \"yyyy-MM-dd\")
required: false
schema:
type: string
format: date
...
openapi-generator generate -i assets/api.yaml -g typescript-rxjs -o src/lib
As in the typescript-fetch generator, write instead of .toISOString():
.toISOString().substr(0,10) or
.toISOString().split('T')[0]
馃憤 Thanks for opening this issue!
馃彿 I have applied any labels matching special text in your issue.
The team will review the labels and make any necessary changes.
Related with: #4623
@denyo could you take a look at this issue? This seems to be easy fixable. I'd appreciate it a lot!
@guidoknoll would you like to implement a fix?
Yeah, i could do that too. But I've never committed to an open source project like this before but I'll try!
as a starting point:
adjust the template in https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/typescript-rxjs/apis.mustache
then run mvn clean package
and re-generate the samples by running https://github.com/OpenAPITools/openapi-generator/blob/master/bin/typescript-rxjs-petstore-all.sh
finally commit the changed templates and the generated samples.
@guidoknoll you can take the package from my forks, there this and some other problems are fixed https://github.com/Xambey/openapi-generator-cli and https://github.com/Xambey/openapi-generator
openapi-generator-cli.zip
The fix was quite easy and no samples changed. @macjohnny to which branch should i commit my changes or can i create my own?
You can fork the repo, create your own branch and then file a PR
Most helpful comment
@guidoknoll you can take the package from my forks, there this and some other problems are fixed https://github.com/Xambey/openapi-generator-cli and https://github.com/Xambey/openapi-generator
openapi-generator-cli.zip