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

fix: Ensure input types are modelled by SwaggerGenerator #1331

Merged
merged 2 commits into from Sep 12, 2018

Conversation

djones6
Copy link
Collaborator

@djones6 djones6 commented Sep 11, 2018

Description

Ensures that input types are included in the list of types (models) described in Kitura's generated swagger. I also added a check to avoid duplicating effort to build the same model where the same type appears in multiple routes (a common occurrence).

Motivation and Context

Fixes a bug in the SwaggerGenerator where the generated swagger document could refer to a model that was not described.

This affected routes that have both an input and output type, but no identifier (eg. POST). For such routes, the input type was not added to the list of models, and so the document was invalid if that same type was not also used as an output type.

How Has This Been Tested?

The changes pass the existing tests. I have not added a specific test to cover this case in this PR, but intend to do so in a follow-up one.

Checklist:

  • If applicable, I have updated the documentation accordingly.
  • If applicable, I have added tests to cover my changes.

@djones6 djones6 merged commit 38ca4d1 into master Sep 12, 2018
@djones6 djones6 deleted the fixSwaggerInputTypes branch September 12, 2018 16:51
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.

None yet

2 participants