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
In my class properties I have some nullable components. In AsyncApiSchema/v2/ComponentFieldName.cs there is a validation of the component field name which does not include the character "`" of my type "nullable`1", which breaks the process.
Just adding the character to ValidRegex fixes the problem:
However, it's a bit unfortunate that the name of a generic type is "generic_1", the type name is not exactly useful.
In your example "nullable_1" could be a nullable anything.
It would be more useful to generate a name for the type, like nullableOfFoo, or listOfBar, or dictionaryOfStringAndFoo.
I will update the SchemaIdSelector to handle generics better by default 👍
Also, we should probably be handling Nullable differently to other generics...
Json Schema allows for { "type": "null" }, see: https://json-schema.org/understanding-json-schema/reference/null.html
Which means we could detect System.Nullable<T> and set the property as { "type": [ "T", "null" ] }. I will investigate this.
In my class properties I have some nullable components. In AsyncApiSchema/v2/ComponentFieldName.cs there is a validation of the component field name which does not include the character "`" of my type "nullable`1", which breaks the process.
Just adding the character to ValidRegex fixes the problem:
Any collateral damage you could think of after adding this?
Thank you for your work!
The text was updated successfully, but these errors were encountered: