-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kotlin null-ability #115
Comments
@GLHF Schema module has no knowledge of these differences, as it relies on information sent by |
/cc @apatrida |
This is for schema generation? Currently the Kotlin module does not provide this information externally, and uses it on the fly when instantiating objects to decide whether there is a problem between the available JSON object properties and the class being instantiated, or whether it should use the default values for optional parameters to constructors. If there is pluggin-ability to the schema generator to provide more information when introspecting a bean/class, then I can add the Kotlin specific knowledge (would require Kotin + possibly Kotlin-reflect if not able to use reflect-lite). This otherwise might require adding the ability to add modules to this module (plugin to the plugin), or adding the Kotlin dependencies and one Kotlin file to do the Kotlin type handling (it is easy to detect a Kotlin class, and then reflection is easier there, in fact introspecting Java Beans is easy from Kotlin because all of the work is done in the reflection library to identify the bean information) Sorry, I don't know this module more to know the best path for someone to add this. The code on the Kotlin end is probably the easy part, its plugging it in that is unknown. |
@apatrida Thank you for the notes. I don't know if this is feasible to support either... and the whole introspection system is a mess, unfortunately (... contribution which was unfortunately based on earlier schema generator, which is too JSON-Schema-specific...). Schema generation relies on information passed via This information ultimately comes via
which may or may not help. |
I`m trying to provide the JSON schema generation for Kotlin data classes/classes that have specific null-able behaviour:
var string: String
- can't be nullvar string: String?
- can be nullIs there specified mechanism for recognizing this types? Or perhaps you plan any kind of support it in future.
The text was updated successfully, but these errors were encountered: