-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Required meta-data for code generation #50
Comments
My only concern: Human-readable vs. Computer IDs The Whatever you do, please give us answers for both cases. |
@yordis are you then proposing that this vocabulary define a new annotation keyword to specify a type name? I'd like to define as little as possible, assigning meaning in this context to keywords we already have, but I'm not opposed to a new keyword if it's needed. |
Another aspect we should consider is limitations of type naming in various programming languages. We should probably stick with common ground. Most languages share support for various casings of alphanumeric-with-underscore (e.g. |
Most definitely, there has been few discussion around it and JSON Schema is lacking of a global key that allows programmers to reserve the value for code-gen sake. |
It may be helpful (in general) if you could link to those discussions. Thanks for the input. |
After considering a bit, I think I'm inclined to agree that a dedicated type name annotation keyword would be ideal. If Defining when to make this required will be interesting. |
Just came across this issue and thought I'd link a discussion I initiated back in March since it seems to be more relevant here: OAI/sig-moonwalk#54. |
I think using
|
Hey @gregsdennis, any updates on this one? I lost track of what happened in the end |
Nothing has happened here. These are all in discussion. |
When generating a schema from a type, we generally have all of the information we need. (I'm having trouble thinking of a type declaration that doesn't have enough information to define a schema.)
However, code generation sometimes requires some annotative keywords. For example,
provides enough information to describe the structure of a type, but a type usually needs a name.
Some types don't need this, though. For an array of objects,
most languages have one or more built-in collection types that can handle this, e.g.
List<T>
in .Net orNSArray
in Objective-C, or even a simple array (which probably every usable language has).For custom objects, though, in order to generate type code correctly, there should be a minimum amount of information present. Specifically,
title
should hold the type namedescription
could map to a comment or other in-code documentation about the typeWe also need to identify when these should be required. Can that be represented in a meta-schema, or will that be up to the generator to decide?
The text was updated successfully, but these errors were encountered: