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

openapi v3 formatter #48

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

openapi v3 formatter #48

wants to merge 9 commits into from

Conversation

Paxa
Copy link

@Paxa Paxa commented Apr 24, 2019

It can generate valid openapi v3 json

run with:

rake swagger_v3

how to use example:

RSpec.configure do |config|
  config.swagger_docs = {
    'v2/swagger.json' => {
      openapi: '3.0.0',
      info: {
        title: 'API V2',
        version: 'v2'
      },
      servers: [{url: 'http://localhost:3000'}],

      components: {
        securitySchemes: { ... },
        schemas: {
          BasicRequest: {
            type: :object,
            properties: {
              user: { type: :string }
            },
            required: [:user]
          }
        }
      }
    }
  }
end

@drewish
Copy link
Owner

drewish commented Apr 25, 2019

Oh neat! I'd toyed with trying to redo the module to fully take advantage of the OpenAPI v3 spec but hadn't gotten very far. I do like the idea of another formatter. Would you be open to adding some specs? I'm also thinking that it might be better to change the rake task name from swagger to openapi to reflect the upstream naming change.

@Paxa
Copy link
Author

Paxa commented Apr 25, 2019

change the rake task name from swagger to openapi to reflect the upstream naming change
yep

I'm new to swagger and openapi, and implemented only changes that was needed for my use case. And some parts just use application/json without proper checking
Did you notice something need to be changed?

@Paxa
Copy link
Author

Paxa commented May 27, 2019

Renamed v3 to openapi
Added tests for openapi
Add example with simple html file

@thg303
Copy link
Contributor

thg303 commented May 4, 2020

why this is not merged yet??

@drewish
Copy link
Owner

drewish commented May 4, 2020

@thg303 i appreciate the enthusiasm but it’d be more productive to chime in with what you’d done to test out the PR

@Paxa
Copy link
Author

Paxa commented Mar 4, 2021

Since I'm not using this library anymore, any help to add tests is welcome

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.

3 participants