-
Notifications
You must be signed in to change notification settings - Fork 6k
[TypeScript][Inversify] fix date path parameters #8047
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
base: master
Are you sure you want to change the base?
[TypeScript][Inversify] fix date path parameters #8047
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me
@gualtierim could you try it with the following code and post it here? paths:
/pet/{birthday}/foo/{id:.+}/{bla_bla}/bar:
get:
tags:
- pet
operationId: findPetsByStatusfoo
produces:
- application/xml
- application/json
parameters:
- name: birthday
in: path
required: true
type: string
format: date-time
- name: id:.+
in: path
required: true
type: string
- name: bla_bla
in: path
required: true
type: string
format: date-time
responses:
'200':
schema:
type: array
items:
$ref: '#/definitions/Pet' |
The result is: public findPetsByStatusfoo(birthday: Date, id_: string, blaBla: Date, observe?: 'body', headers?: Headers): Observable<Array<Pet>>;
public findPetsByStatusfoo(birthday: Date, id_: string, blaBla: Date, observe?: 'response', headers?: Headers): Observable<HttpResponse<Array<Pet>>>;
public findPetsByStatusfoo(birthday: Date, id_: string, blaBla: Date, observe: any = 'body', headers: Headers = {}): Observable<any> {
....
const response: Observable<HttpResponse<Array<Pet>>> = this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(birthday.toISOString()))}/foo/${encodeURIComponent(String(id_))}/${encodeURIComponent(String(blaBla.toISOString()))}/bar`, headers);
if (observe == 'body') {
return response.map(httpResponse => <Array<Pet>>(httpResponse.response));
}
return response;
} |
Excellent, so it seems to be correct |
Circleci failing seems to be unrelated:
|
@TiFu I forked the master and i make only the changes described in the PR. In my opinion the error is unrelated. I didn't change dependencies or tests. |
In the README is not present any reference to the typescript-inversify. Maybe it can be useful. Thanks! |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.3.0.0
branch for changes related to OpenAPI spec 3.0. Default:master
.Description of the PR
Fix the date path parameters as in the PR #7479
@TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx @macjohnny