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

API Blueprint view object respects required: false for parameters now #388

Merged
merged 3 commits into from
Aug 14, 2018

Conversation

BrandonMathis
Copy link
Contributor

@BrandonMathis BrandonMathis commented Aug 6, 2018

What Changed

API Blueprint renderer will not flag parameters as optional if required: false is set

Why

By default, API Blueprint considers all parameters as required. This change adjusts the API Blueprint view object's logic to set "optional" on a parameter if required: false is set.

note: if this has the potential to be merged in. I will gladly add test and offer further explanation if needed

@oestrich
Copy link
Contributor

oestrich commented Aug 6, 2018

This definitely has potential to be merged in. Does blueprint treat all values as required unless optional is present? Just want to make sure we don't break it in the opposite direction.

@BrandonMathis
Copy link
Contributor Author

Thankyou for the fast response and great work with this gem!

Yes, API Blueprint treats all parameters as required unless you set optional

The specific line in the documentation where I discovered this is here

https://apiblueprint.org/documentation/specification.html#def-uriparameters-section#uri-parameters-section

screen shot 2018-08-06 at 4 13 34 pm

@oestrich
Copy link
Contributor

oestrich commented Aug 6, 2018

If you can get that one test passing I think we're good to merge this.

@BrandonMathis
Copy link
Contributor Author

Okay! Should all parameters be optional unless required: true is explicitly defined? I think so. I don't believe the docs specify 😇

@BrandonMathis
Copy link
Contributor Author

BrandonMathis commented Aug 6, 2018

I am struggling a little bit to resolve this last failing cucumber feature but I cannot find the generated doc/api/index.apib which this feature spec compares against.

Any help would be appreciated!

@BrandonMathis
Copy link
Contributor Author

Nevermind! Looks like my fix did work and all is well.

I would very much appreciate a merge and deployment to rubygems if possible. Let me know if there is anything else that I should change.

@oestrich oestrich merged commit 88f2837 into zipmark:master Aug 14, 2018
@oestrich
Copy link
Contributor

Thanks!

@BrandonMathis BrandonMathis deleted the bugfix/apidoc-optional-parameters branch August 23, 2018 15:37
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

Successfully merging this pull request may close these issues.

2 participants