Giter VIP home page Giter VIP logo

Comments (5)

kemingy avatar kemingy commented on May 22, 2024

I'm using this library to generate swagger:2.0 spec and ran into few issues with the generated spec via .spec attribute.

May I know the reason to use 2.0 instead of 3.0?

1. editor.swagger.io expects `swagger: '2.0'` for the version instead of the generated `openapi: '2.0'`

Yeah, this needs to be swagger: '2.0' or openapi: '3.0.n'

2. under paths, the correct key is `operationId` but generated version has `operationID` which errors out as invalid
should NOT have additional properties
additionalProperty: operationID

Additional context
I'm happy to submit a PR if allowed to fix above issues as long as the maintainer agrees with above issues.

Welcome PR. To make it compatible with swagger 2.0, maybe we need to do a lot of work. Check the official document about the difference between swagger 2.0 and OpenAPI 3.0: https://swagger.io/blog/news/whats-new-in-openapi-3-0/ .

from spectree.

natasha-aleksandrova avatar natasha-aleksandrova commented on May 22, 2024

After spending some time on this yesterday, yes too many changes to make it support 2.0 as well.

We use Google Endpoints which only supports 2.0 version, it's a gateway service that uses openapi spec (in this case 2.0).

I have another workaround for making it work with google endpoints.. but operationID is only invalid in openapi3.0 and should be fixed to operationId.

from spectree.

kemingy avatar kemingy commented on May 22, 2024

After spending some time on this yesterday, yes too many changes to make it support 2.0 as well.

OK. Maybe we don't have to do this now.

We use Google Endpoints which only supports 2.0 version, it's a gateway service that uses openapi spec (in this case 2.0).

I have another workaround for making it work with google endpoints.. but operationID is only invalid in openapi3.0 and should be fixed to operationId.

I see. Then you can create a PR to fix this. Thanks.

from spectree.

kemingy avatar kemingy commented on May 22, 2024

Additional context
I'm happy to submit a PR if allowed to fix above issues as long as the maintainer agrees with above issues.

I think this can be fixed by changing this line:

'operationID': f'{name}__{method.lower()}',

Feel free to submit a PR.

from spectree.

natasha-aleksandrova avatar natasha-aleksandrova commented on May 22, 2024

Ive got fixes in my fork just haven't had a chance to get the PR going - will submit a fix shortly. Thanks!

from spectree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.