-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Description
Hi! It seems the openapi connector is not setting the correct TS type when setting true the nullable flag
For example, with the following JSON OpenAPI definition model:
"TestObject": {
"type": "object",
"properties": {
"name": {
"type": "string",
"nullable": true,
"default": null,
"description": "Test property",
"example": null
},
It creates a model with the following property:
@property({jsonSchema: {
type: [
'string',
'null',
],
default: null,
description: 'Specific endpoint for this queue, if not specified, the generic endpoint for this service will be used',
}})
endpoint?: string = null;
Obviously, as endpoint is set as string, it throws a TS Check error in build time:
error TS2322: Type 'null' is not assignable to type 'string | undefined'.
Why isn't setting the property type correctly, whereas in the type annotation seems to be aware of it?
Thanks!
Metadata
Metadata
Assignees
Type
Projects
Status
Icebox