question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swagger.next: Let's not use hashes anymore

See original GitHub issue

Putting paths and operations in a hash made all sort of problems. The biggest problem is keeping order status of paths and operations. Tags can help organize the paths and operations but that’s not enough. Most of people expect Swagger document keep it’s order status when they are authoring one. Other problem with using hashes is that we are using keys as a data storage. This makes it impossible to have other keys in paths or operation because every key is a path or operation.

Lets use arrays for the next version and make life easier for everyone. It will not make specs uglier. Here is an example:

# Example YAML for the bare minimum of required elements
# See petstore.yaml for a more comprehensive example
swagger: '3.0'
info:
  version: "1.0.0"
  title: petstore
paths:
  - 
    path: /pets # maybe path can have multiple endpoints like `path: [ "/pets", "/animals"]
    consumes:  # path level consumes 
      - "text/html"
    operations:
      - method: get # maybe we can define a batch of operations in one operation i.e. `methods: [ "post", "head"]
        responses:
          - 
            code: "200" # ability to have responses defined by code OR other means (solving response overloading issue)
            description:  Describe the 200 response in more detail

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
webroncommented, Apr 12, 2016

Voting to close.

1reaction
fehguycommented, Apr 11, 2016

@OAI/tdc propose closing this with no action, please approve / reject

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Make Swagger Codegen Work For Your Team - Medium
Swagger Codegen, the open source API client code generator, can be an extremely powerful, timesaving collaborative tool for your team.
Read more >
Advanced Data - API Handyman
Writing OpenAPI (Swagger) Specification Tutorial Series ... This tutorial teaches everything about the OpenAPI 2.0 Specification (fka. as Swagger) ...
Read more >
Swagger complex response model with dynamic key value ...
What I'm trying to model is a hash map with dynamic keys and values. This is needed to allow a localization. The languages...
Read more >
Building Client SDKs with Swagger Codegen
Swagger CodeGen– original code generation tool supported by SmartBear. We will use Swagger CodeGen to generate client SDKs for the Alma User API ......
Read more >
Extending OpenAPI - FastAPI - tiangolo
The API docs use Swagger UI and ReDoc, and each of those need some JavaScript and CSS files. By default, those files are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found