Skip to content

Conversation

@anupsaund
Copy link

Colon prefix parameter substitution

Description

Detect if a colon exists in the URL and then attempt to substitute matched parameter.

Motivation and Context

I have created OpenAPI v3 spec generation in JAVA using Vertx framework. This generates urls which have colon prefixed parameters in the PATH rather than bracketed path variables. I needed to be able to substitute colon parameters if detected.

How Has This Been Tested?

Source code changes ported over into swagger-ui-bundle.js for testing.

Screenshots (if appropriate):

capture

Types of changes

  • No code changes (changes to documentation, CI, metadata, etc)
  • Dependency changes (any modification to dependencies in package.json)
  • Bug fix (non-breaking change which fixes an issue)
  • [ x ] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [ x ] My code follows the code style of this project.
  • [ x ] My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • [ x ] All new and existing tests passed.

@shockey
Copy link
Contributor

shockey commented Jul 4, 2018

Hi @anupsaund!

We're unable to add support for this, since it's not part of the Swagger/OpenAPI Specification.

If you'd like support for colon notation in parameters, the first step is to start a discussion on the OpenAPI Specification repository: https://github.com/OAI/OpenAPI-Specification/issues/new.

If it's added to a future version of the specification, we can then add support for it here 😄

Also note that you could (and for now, should) modify the output of your generator to translate colon path parameters to the templating format that OpenAPI calls for today.


I'm going to close this out since it's not possible to accept such a change at this time. Thanks for your efforts!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants