[typescript-axios] Fix model property naming#10447
[typescript-axios] Fix model property naming#10447macjohnny merged 3 commits intoOpenAPITools:masterfrom
Conversation
|
@TiFu (2017/07) @taxpon (2017/07) @sebastianhaas (2017/07) @kenisteward (2017/07) @Vrolijkx (2017/09) @macjohnny (2018/01) @topce (2018/10) @akehir (2019/07) @petejohansonxo (2019/11) @amakhrov (2020/02) |
|
@aiven-hh can you please resolve merge the latest master and re-generate the samples? |
Disables MODEL_PROPERTY_NAMING for typescript-axios generator as this was never supported (templates have no mapping between original property names and formatted names). Wraps all properties in model interfaces with '' to support most characters except ' for now. Also fixes missing options typing that was any before.
34a8637 to
ef3c20b
Compare
|
Rebased, all major changes still in the first commit. New sample and |
|
@aiven-hh thanks for your contribution. One minir thing: if the model property name contains a dot, it is still converted to underscore |
|
Looks like this breaks the build: Can you please take a look when you've time? |
|
@wing328 Hmm, the change exposed another bug in the original templates, the generated code uses options.query when axios does not actually use |
|
@macjohnny are you sure? If you check the original example here: |
|
@aiven-hh would you like to provide a fix? Or should we first revert the PR? |
|
Whatever you prefer, I can send the fix pr in a few minutes after I verify the fix. |
|
@macjohnny the fix is now in #10512 |
The property names in typescript-axios models were using formatted names instead of baseName and the template has no mapping to original baseName so this PR introduces a fix by:
''for now to support at least all characters except 'This should fix #9524.
Also adds fake petstore example to be able verify these changes at least by eye, see
samples/client/petstore/typescript-axios/builds/test-petstore/api.tsandSpecialModelNameinterface as an example.In addition adds typing for options that was typed as any before.
PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master(5.3.0),6.0.x