Skip to content
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

Does the JSON schema match ProtoJSON input or output? #52

Open
timostamm opened this issue Feb 18, 2025 · 0 comments
Open

Does the JSON schema match ProtoJSON input or output? #52

timostamm opened this issue Feb 18, 2025 · 0 comments

Comments

@timostamm
Copy link
Member

The example in the README includes:

// Product.Location.schema.json
{
  ...
  "properties": {
    "lat": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "string"
        },
        {
          "enum": ["NaN", "Infinity", "-Infinity"],
          "type": "string"
        }
      ]
    },
...

The field is a Protobuf float. Parsers need to accept number, string, the special strings "NaN", "Infinity", "-Infinity", and also null. But implementations should only emit number and the special strings. (See ProtoJSON docs.)

The JSON schema allows number and the special strings, but also any other string. Does the schema aim to match what a conformant parser can parse, or what's emitted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant