Coder Social home page Coder Social logo

Comments (6)

duncanhall avatar duncanhall commented on June 27, 2024

Wow, I hadn't realised this was still in use. Is this still an issue now that swagger-api/swagger-ui#621 has been resolved/closed?

If so I'll have a look at accepting input from stdin.

from expand-swagger-refs.

Dunedan avatar Dunedan commented on June 27, 2024

I don't know about this particular issue, but it's quite handy when deploying an AWS API Gateway via a swagger template, as AWS has a limitation that they don't support references in response definitions (see https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html for details).

from expand-swagger-refs.

duncanhall avatar duncanhall commented on June 27, 2024

Ah, I hadn't even considered AWS Gateway. I'm likely to run into that issue myself at some point so I'll try and get this done soon.

from expand-swagger-refs.

duncanhall avatar duncanhall commented on June 27, 2024

@Dunedan If you're able to provide a sample schema that requires expansion that would be a great help.

from expand-swagger-refs.

Dunedan avatar Dunedan commented on June 27, 2024

The following one should be a pretty minimal example, which requires expansion, before it works with AWS API Gateway:

{
  "swagger" : "2.0",
  "info" : {
    "version" : "1.0.0",
    "title" : "Foo"
  },
  "paths" : {
    "/foo" : {
      "get" : {
        "parameters" : [ ],
        "responses" : {
          "200" : {
            "$ref" : "#/responses/bar"
          }
        },
        "x-amazon-apigateway-integration" : {
          "type" : "mock",
          "responses" : {
            "default" : {
              "statusCode" : 200
            }
          },
          "requestTemplates" : {
            "application/json" : "{\"statusCode\" : 200}\n"
          },
          "passthroughBehavior" : "when_no_match"
        }
      }
    }
  },
  "responses" : {
    "bar" : {
      "description" : "bar"
    }
  }
}

from expand-swagger-refs.

duncanhall avatar duncanhall commented on June 27, 2024

This util has been completely rewritten as an npm module and now supports stdin as well as direct function calls. See the homepage for more details and please raise any other issues/features separately.

from expand-swagger-refs.

Related Issues (2)

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.