-
Notifications
You must be signed in to change notification settings - Fork 218
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
Stopgap: MongoDB $jsonSchema #3953
Conversation
if let Some(walker) = doc_count.collection_walker { | ||
if walker.has_schema() { | ||
model.documentation("json schema msg") | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds the documentation message that goes into the schema file above the model
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make sure we agree on the message to render, before accepting json schema msg
in this PR :)
render_warnings( | ||
"The following models have a JSON Schema defined in the database, which is not yet fully supported. Read more: https://pris.ly/d/todo", | ||
&self.json_schema_defined, | ||
f | ||
)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds the cli warning message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, let's make sure we give the pris.ly
link a proper URL. https://pris.ly/d/mongodb-jsonschema should be good enough
CodSpeed Performance ReportMerging #3953 Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good PR so far! I'm requesting changes just so we don't accidentally forget about changing a few strings before merging
if let Some(walker) = doc_count.collection_walker { | ||
if walker.has_schema() { | ||
model.documentation("json schema msg") | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make sure we agree on the message to render, before accepting json schema msg
in this PR :)
if let Some(walker) = doc_count.collection_walker { | ||
if walker.has_schema() { | ||
model.documentation("json schema msg") | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be tempted to refactor this into an Option::filter
just to avoid two nested if
s, but this is just a minor nit
render_warnings( | ||
"The following models have a JSON Schema defined in the database, which is not yet fully supported. Read more: https://pris.ly/d/todo", | ||
&self.json_schema_defined, | ||
f | ||
)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, let's make sure we give the pris.ly
link a proper URL. https://pris.ly/d/mongodb-jsonschema should be good enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic looks good 👍 I think we only need the messages work, indeed.
part of https://github.com/prisma/schema-team/issues/403
contributes to: prisma/prisma#8135