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

Ability to use stdin and stdout #1

Closed
Dunedan opened this issue Mar 22, 2017 · 6 comments
Closed

Ability to use stdin and stdout #1

Dunedan opened this issue Mar 22, 2017 · 6 comments
Assignees

Comments

@Dunedan
Copy link

Dunedan commented Mar 22, 2017

I'd really appreciate to see the ability to use stdin as input source and stdout as output source for the script, as that'd allow transformation of data, without writing it to (temporary) files in between.

@duncanhall
Copy link
Owner

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.

@Dunedan
Copy link
Author

Dunedan commented Mar 22, 2017

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).

@duncanhall
Copy link
Owner

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.

@duncanhall
Copy link
Owner

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

@Dunedan
Copy link
Author

Dunedan commented Mar 24, 2017

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"
    }
  }
}

@duncanhall duncanhall self-assigned this Mar 24, 2017
@duncanhall
Copy link
Owner

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.

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

No branches or pull requests

2 participants