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

Missing $id in generated json-schema #73

Closed
FabioReact opened this issue Sep 9, 2021 · 3 comments · Fixed by #105
Closed

Missing $id in generated json-schema #73

FabioReact opened this issue Sep 9, 2021 · 3 comments · Fixed by #105
Labels

Comments

@FabioReact
Copy link

Hi,

I was looking to add/modify validations rules, and found an issue about it here. I do agree with your choice of keeping it away from this library. It is also quite easy to use $ref to do the job. But to do that, the original json-schema must have an $id to reference it.

Is it ok if i open a PR to fix it (along with the test)?

Thanks @valentinpalkovic

@valentinpalkovic
Copy link
Owner

Hey @FabioReact!

Thank you for opening this issue. Can you explain a bit further, how the generated JSON schema should look like after your changes? I would like to understand what your exact proposal is!

@FabioReact
Copy link
Author

FabioReact commented Sep 10, 2021

It should only add a new key/value pair, such as:
{ "$id": "prisma-json-schema", "$schema": "http://json-schema.org/draft-07/schema#" ... }
That way, each time you generate a new json-schema from a new prisma schema, you will keep the same $id (in json-schema.json) in case you need to reference it.

valentinpalkovic added a commit that referenced this issue Sep 26, 2021
Added option to add a schema id to the generated json schema.

Fixes #73
valentinpalkovic added a commit that referenced this issue Sep 26, 2021
Added option to add a schema id to the generated json schema.

Fixes #73
github-actions bot pushed a commit that referenced this issue Sep 26, 2021
# [1.5.0](v1.4.0...v1.5.0) (2021-09-26)

### Features

* add schema id option ([1d9ac04](1d9ac04)), closes [#73](#73)
@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 1.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

2 participants