Skip to content
This repository has been archived by the owner on Mar 21, 2019. It is now read-only.

"Try it out!" feature fails if required query params are shown in header #66

Open
makotogitdev opened this issue Jul 29, 2014 · 3 comments
Labels

Comments

@makotogitdev
Copy link
Collaborator

"Try it out!" feature fails if required query params are shown in header, since Swagger-UI's javascript appends query params upon submission.

@makotogitdev
Copy link
Collaborator Author

This was introduced by implementing issue #60. To fix this issue, in Swagger.js, add the following method and edit "SwaggerOperation.protorype.urlify".

    SwaggerOperation.prototype.pathWithoutQuery = function () {
        if (!this.path.contains("?")) { return this.path; }
        var queryPosition = this.path.indexOf("?");
        return this.path.substring(0, queryPosition);
    };

and replace "this.pathJson()" in "urlfity" with "this.pathWithoutQuery()"

@makotogitdev
Copy link
Collaborator Author

Realized that #60 should've been implemented in Swagger-UI layer since it is not a problem with models but is a presentation change. Will ask Swagger-UI project to see how difficult it may be to do it and still have "Try it out!" to work.

@makotogitdev
Copy link
Collaborator Author

I started a discussion with Swagger UI team but they closed the issue and claimed that it is a spec issue. Hmm.

swagger-api/swagger-ui#506

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

No branches or pull requests

1 participant