forked from loafle/openapi-generator-original
[typescript][axios] Add any to index type when additionalPropertiesIsAnyType is true (#16494) (#17625)
This commit is contained in:
parent
eb7d2d9fd2
commit
5397f64595
@ -226,6 +226,11 @@ public class TypeScriptAxiosClientCodegen extends AbstractTypeScriptClientCodege
|
|||||||
for (ModelMap mo : models) {
|
for (ModelMap mo : models) {
|
||||||
CodegenModel cm = mo.getModel();
|
CodegenModel cm = mo.getModel();
|
||||||
|
|
||||||
|
// Type is already any
|
||||||
|
if (cm.getAdditionalPropertiesIsAnyType() && "any".equals(cm.getAdditionalPropertiesType())) {
|
||||||
|
cm.setAdditionalPropertiesIsAnyType(false);
|
||||||
|
}
|
||||||
|
|
||||||
// Deduce the model file name in kebab case
|
// Deduce the model file name in kebab case
|
||||||
cm.classFilename = cm.classname.replaceAll("([a-z0-9])([A-Z])", "$1-$2").toLowerCase(Locale.ROOT);
|
cm.classFilename = cm.classname.replaceAll("([a-z0-9])([A-Z])", "$1-$2").toLowerCase(Locale.ROOT);
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
export interface {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{
|
export interface {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{
|
||||||
{{#additionalPropertiesType}}
|
{{#additionalPropertiesType}}
|
||||||
[key: string]: {{{additionalPropertiesType}}}{{^additionalPropertiesIsAnyType}}{{#hasVars}} | any{{/hasVars}}{{/additionalPropertiesIsAnyType}};
|
[key: string]: {{{additionalPropertiesType}}}{{#additionalPropertiesIsAnyType}}{{#hasVars}} | any{{/hasVars}}{{/additionalPropertiesIsAnyType}};
|
||||||
|
|
||||||
{{/additionalPropertiesType}}
|
{{/additionalPropertiesType}}
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
|
@ -447,7 +447,7 @@ export interface Dog extends Animal {
|
|||||||
* @interface Drawing
|
* @interface Drawing
|
||||||
*/
|
*/
|
||||||
export interface Drawing {
|
export interface Drawing {
|
||||||
[key: string]: Fruit;
|
[key: string]: Fruit | any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -1043,7 +1043,7 @@ export interface Name {
|
|||||||
* @interface NullableClass
|
* @interface NullableClass
|
||||||
*/
|
*/
|
||||||
export interface NullableClass {
|
export interface NullableClass {
|
||||||
[key: string]: object;
|
[key: string]: object | any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -811,7 +811,7 @@ export interface Name {
|
|||||||
* @interface NullableClass
|
* @interface NullableClass
|
||||||
*/
|
*/
|
||||||
export interface NullableClass {
|
export interface NullableClass {
|
||||||
[key: string]: object;
|
[key: string]: object | any;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user