Closed josephspurrier closed 4 years ago
@josephspurrier Another good issue and thanks for posting it. This has been on my list of tasks for some time. It's caused by the use of Google's Protocol Buffers on the backend which converts everything to a number
:
from google.protobuf import json_format, struct_pb2
if __name__ == '__main__':
list_value = struct_pb2.ListValue()
list_value.append(1)
result = json_format.MessageToDict(list_value)
print(result)
Running this Python code outputs: [1.0]
. The examples
keyword is implemented using ListValue.
I am going to look at this again and see if there's a reasonably nice way around it.
@josephspurrier I'm working on significant improvements to the examples
, default
, const
, and enum
keywords which will fix this. I'll keep this issue updated.
@josephspurrier I've improved the handling of types on www.jsonschema.net. Does it now behave as you wanted?
Closing this as it's now working and there's not update from OP.
When I paste in this code to the generator (https://jsonschema.net/home), it comes back with an example that says 1.0 instead of 1.
Here is what comes back:
Is there a way for the example to not have a decimal?