Closed will7200 closed 3 years ago
@will7200 Hey, can you let me see the different result of the generation before and after?
@will7200 maybe you should show the changed after your PR.
@Manweill Examples:
export type ResponseWithAdditionalParametersWithAdditionalProperties = ResponseWithAdditionalParameters & {
};
export interface ResponseWithOnlyAdditionalParameters {
/** */
}
Now lies the problem of how to use the new type instead of the interface if the model has existing properties
@Manweill Examples:
- If there properties defined on the model it will export an additional type with a union type.
export type ResponseWithAdditionalParametersWithAdditionalProperties = ResponseWithAdditionalParameters & { [additionalProperties: string]: object; };
- If there are no properties defined on the model:
export interface ResponseWithOnlyAdditionalParameters { /** */ [additionalProperties: string]: number; }
Now lies the problem of how to use the new type instead of the interface if the model has existing properties
It will not affect existing code?
Yeah its an enhancement and is backwards compatible with your existing code base. If they don't define additional properties or it is set to false it will retain the current behavior.
My implementation of additional properties so they can be types.