[TypeScript][Inversify] fix date path parameters
PR checklist
- [x] Read the contribution guidelines.
- [x] Ran the shell script under
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.shand./bin/security/{LANG}-petstore.shif 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\. - [x] Filed the PR against the correct branch:
3.0.0branch for changes related to OpenAPI spec 3.0. Default:master. - [x] Copied the technical committee to review the pull request if your PR is targeting a particular programming language.
Description of the PR
Fix the date path parameters as in the PR #7479
@TiFu @taxpon @sebastianhaas @kenisteward @Vrolijkx @macjohnny
@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:
[info] downloading https://jcenter.bintray.com/jline/jline/2.12.1/jline-2.12.1.jar ...
[warn] [FAILED ] jline#jline;2.12.1!jline.jar: The HTTP response code for https://jcenter.bintray.com/jline/jline/2.12.1/jline-2.12.1.jar did not indicate a success. See log for more detail. (36ms)
[warn] [FAILED ] jline#jline;2.12.1!jline.jar: The HTTP response code for https://jcenter.bintray.com/jline/jline/2.12.1/jline-2.12.1.jar did not indicate a success. See log for more detail. (36ms)
[warn] ==== jcenter: tried
[warn] https://jcenter.bintray.com/jline/jline/2.12.1/jline-2.12.1.jar
@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!