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

Confusing examples and anti-examples #284

Closed
colesimmons opened this issue Oct 20, 2020 · 3 comments
Closed

Confusing examples and anti-examples #284

colesimmons opened this issue Oct 20, 2020 · 3 comments
Labels
question Further information is requested

Comments

@colesimmons
Copy link
Contributor

Consider the examples and anti-examples for ResourceMethodCreateSchema.

Screen Shot 2020-10-20 at 2 49 57 PM

The only difference between the 2nd example and the anti-example is the presence of hidden in display, which is a valid key for BasicDisplaySchema.

@colesimmons colesimmons added the question Further information is requested label Oct 20, 2020
@codebycaleb
Copy link
Contributor

Hey @colesimmons! I think I can clarify this one. The focus here is that an operation.sample is required unless display.hidden is true. That nuance is covered in the description of BasicActionOperationSchema.

What does a sample of data look like? Will use resource sample if missing. Requirement waived if display.hidden is true or if this belongs to a resource that has a top-level sample

@colesimmons
Copy link
Contributor Author

@codebycaleb Ah, thanks Caleb! That makes sense, though I still wouldn't consider that an anti-example as it could belong to a resource that has a top-level sample.

I'll go ahead and close this since it does answer my question. I'll try to put together a PR when I have a chance that will hopefully clarify some of the points where I got stuck while working on Abstract's integration.

@xavdid
Copy link
Contributor

xavdid commented Oct 23, 2020

Appreciate that - the examples and anti-exampes are a little confusing in the first place because they're only there to show json that is either valid or invalid based on the schema. So they're not examples in the traditional sense of showing the reader a basic way to do something.

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

No branches or pull requests

3 participants