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

[feature] Support extended json #90

Open
1aam2am1 opened this issue May 10, 2024 · 1 comment
Open

[feature] Support extended json #90

1aam2am1 opened this issue May 10, 2024 · 1 comment

Comments

@1aam2am1
Copy link

Hi, I would like to request a extension to json support:

  • inline comments
    { // some comment 
    "key": "value" // some comment
    }
  • block comments
    { /* Block comment
    Or multiline
    */
    "key": "value"
    }
  • enum value not as string
  {
  "key": enum_value,
  "key_second": "other_value"
  }

As for example these jsons are valid for flatbuffer complier
https://flatbuffers.dev/flatbuffers_guide_writing_schema.html#autotoc_md29

And pydantic would be great for batch processing of such JSON configurations.

@davidhewitt
Copy link
Collaborator

As per #91 I think comment support is straightforward subject to performance impact.

For the enum values, that's a much more complicated / interesting idea which would have a strong interaction with pydantic-core. I'm open to someone exploring this idea, but it's a much bigger feature request and would have questions all the way up to the pydantic main API (as I assume users would want to be able to configure this).

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

2 participants