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

Created setting to generate output as JSON #31

Merged
merged 1 commit into from
Oct 11, 2021

Conversation

dannnylo
Copy link
Contributor

I added the option to generate the output as JSON.
Only configure the option RSpec::OpenAPI.output = :json and the content will generate the json content.

Could you add the label hacktoberfest to your repository, I would be very grateful?

@k0kubun k0kubun merged commit 924297b into exoego:master Oct 11, 2021
@dannnylo dannnylo deleted the output_json branch October 11, 2021 10:57
@@ -38,4 +51,8 @@ def prepend_comment(content)
end
"#{comment.gsub(/^/, '# ').gsub(/^# \n/, "#\n")}#{content}"
end

def json?
RSpec::OpenAPI.output.to_s == 'json'
Copy link
Contributor

Choose a reason for hiding this comment

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

arguably instead it should check File.extname(@path) == ".json" and rely on that

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good call. I did so in v0.4.0 25f0798.

Copy link
Contributor Author

@dannnylo dannnylo Oct 11, 2021

Choose a reason for hiding this comment

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

Really your alternative is better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants