Open gregsdennis opened 1 year ago
Json schema type integer allows integer and float types with integer values. Should code generation represent that as integer only? If so then that is a departure form json schema definitions.
I think that depends on the lanuage being generated.
Typescript doesn't have an integer type, so it won't care.
C# has both, and the serializer will actually decode 1.0
as an integer.
I don't think we can specify how individual languages support things. We can only generalize.
Subschemas and nested types appear everywhere. Generally, a subschema will represent a new type.
For this schema, we have four types being represented:
foo
andbar
/properties/bar
(#45 discusses built-in types, so we'll leave that out of this issue.)
Specifically, we need to focus on the two custom objects: the top-level and whatever
bar
is.I would expect a generator to create two types from this schema. Are there any restrictions that people can see?
What happens when a subschema is duplicated?
Here,
/properties/bar
and/properties/baz
are identical. Is this the author's intent, or are these two semantically (business rules) different yet functionally (shape/structure) identical? Do we need a way to discern this? Maybe #50 can help identify author intent. For example, if the subschemas have the sametitle
, it was intended that they're the same type.(
$ref
'd subschemas are obviously the same type.)