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 request: ignore $schema node #1323

Open
ericnewton76 opened this issue May 4, 2022 · 1 comment
Open

Feature request: ignore $schema node #1323

ericnewton76 opened this issue May 4, 2022 · 1 comment

Comments

@ericnewton76
Copy link
Contributor

ericnewton76 commented May 4, 2022

Json schema standard allows for a "$schema" property added to the root object of a json document. Many IDEs like VSCode can enforce schema/describe properties for the user.

I propose adding a special case for json-server to ignore the initial "$schema" : "./myapi-schema.json" node

So FYI a db.json file would look like:

{
  "$schema": "./db-schema.json",
  "posts": [],
  "comments": []
}

This could eventually morph into support for emitting 405 Bad Request for incoming data that doesnt match schema but thats not in scope for this particular effort.

@ericnewton76
Copy link
Contributor Author

IF I were to add a pull request, tbh I dont know how I'd test it beyond "doesnt error with $schema node"

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