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

More API Blueprint fixes #2

Merged

Conversation

icidasset
Copy link

@icidasset icidasset commented Feb 14, 2018

Hi 👋

Thanks for fixing the API Blueprint stuff.
Here are some further improvements I made (possibly):

  • Adds api explanation to the template
  • Adds the ability to define explanations for routes and methods (eg. get ...)
  • Properly renders attributes
  • Improve parameter/attribute properties (set to "optional" if not required, reverse direction)

Does this fix the issue you have with attributes?

@icidasset icidasset force-pushed the fix-api-blueprint-format branch from a0baadf to bb5546d Compare February 14, 2018 18:29
@@ -16,34 +19,49 @@ FORMAT: 1A
## {{ route_name }} [{{ route }}]
{{# description }}

description: {{ description }}
{{ description }}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what value this should have... or if it even works.

Copy link

@yld yld Feb 15, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks, we just need to add apiblueprint validations in spec suite, and we'll be done.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the specs, and added an expectation for the "route explanations". I can't seem to write an expectation for the "method explanations", although it works when I use the gem. Something seems off with the http_methods in the specs for some reason.

{{# attributes }}
+ {{ name }}{{# example }}: {{ example }}{{/ example }}{{# properties_description }} ({{ properties_description }}){{/ properties_description }}{{# description }} - {{ description }}{{/ description }}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

example is the RSpec example in this case, which we don't want. I wanted to render the actual value of the param here, but I don't think it's possible without some serious refactoring. I did add the ability to define the "default" though.

Anyhow, if you have an idea how we could get the actual parameter value in here that would be amazing 🙏

@yld yld merged commit 2f56cb8 into FinalCAD:fix-api-blueprint-format Mar 22, 2018
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