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

Fixes #115

Merged
merged 6 commits into from
Jan 31, 2020
Merged

Fixes #115

merged 6 commits into from
Jan 31, 2020

Conversation

bf4
Copy link
Contributor

@bf4 bf4 commented Jan 30, 2020

  1. Add test app manifest to the dummy app fixes some the spec test failures
  2. Handle formatting acceptable non-json strings from rspec-api-documentation
  3. Add general error handlers

no tests at this time.. just review for the shape of it, breaking it up, whatever

Fixes

@@ -80,14 +80,19 @@ def rendered_markdown(string)
end

def formatted_body(body, type)
return body if body == " "
return body if body == "[binary data]" # see https://github.com/zipmark/rspec_api_documentation/blob/560c3bdc7bd5581e7c223334390221ecfc910be8/lib/rspec_api_documentation/client_base.rb#L88-L96
Copy link
Contributor Author

Choose a reason for hiding this comment

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

refactor and 🐞 fix

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the "[binary data"] change was related in our app to changing from - rack (2.0.8) to rack (2.1.1)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

raise JSON::ParserError
rescue => e
if Apitome.configuration.formatted_body_error_handler
Apitome.configuration.formatted_body_error_handler.call(e, body, type)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

<%
rescue => e
if Apitome.configuration.example_error_handler
Apitome.configuration.example_error_handler.call(e, "request", request)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

<%
rescue => e
if Apitome.configuration.example_error_handler
Apitome.configuration.example_error_handler.call(e, "response", request)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -0,0 +1,3 @@
//= link apitome/application.css
//= link apitome/application.js
//= link apitome/highlight_themes/default.css
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🐞 fix

bf4 referenced this pull request in zipmark/rspec_api_documentation Jan 31, 2020
Do not display binary data in generated documentation. Closes #199.
@jejacks0n jejacks0n merged commit 5b85680 into jejacks0n:master Jan 31, 2020
@bf4 bf4 deleted the fixes branch January 31, 2020 18:52
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