You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"definitions": {
"BaseEntityWithoutId": {
"required": [],
"properties": {
"createdAt": {
"type": "string",
"description": "The creation date of the object."
},
"updatedAt": {
"type": "string",
"description": "The last update date of the object."
},
"version": {
"type": "integer",
"description": "The current version of the object."
}
}
},
"BaseEntity": {
"required": [
"id"
],
"properties": {
"id": {
"type": "integer",
"description": "The auto-generated object id."
}
},
"allOf": [
{
"$ref": "#/definitions/BaseEntityWithoutId"
}
]
}
}
Generates the following file:
export interface BaseEntityWithoutId {
/** The creation date of the object. */
createdAt?: string;
/** The last update date of the object. */
updatedAt?: string;
/** The current version of the object. */
version?: number;
}
export type BaseEntity = { id: number } & { id: number };
Removing the 'id' from required fixes it slightly and gives the following output:
export interface BaseEntityWithoutId {
/** The creation date of the object. */
createdAt?: string;
/** The last update date of the object. */
updatedAt?: string;
/** The current version of the object. */
version?: number;
}
export type BaseEntity = BaseEntityWithoutId & { id?: number };
Am I doing something wrong or is this a bug?
The text was updated successfully, but these errors were encountered:
The following definitions
Generates the following file:
Removing the 'id' from required fixes it slightly and gives the following output:
Am I doing something wrong or is this a bug?
The text was updated successfully, but these errors were encountered: