Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ok...so...
swagger-codegen appears to only consider the first element listed in
"content"
(see #515 (comment)).I am making some concessions to get functional auto-generated swagger clients and also maintain as much existing functionality as possible. This is what I have come up with.
this new PR produces the following on each path listed in swagger:
with the above, the python version of the swagger client template-generates
response_type='object'
for each end point method. I have not tested other languages.Without any special headers added, this results in the generated python client returning a byte string of the xml response doc.
With
"Accept":"application/json"
added to the headers, the generated python client smoothly returns a python dict.IMO, I think this is the best approach for now. AFAIK this is the most minimal response definition and it gets us going with rapidly generated swagger clients.
In the future, we could consider adding schemas for at least the rest-specific portions of mtconnect such as MTConnectDevices/MTConnectStreams/MTConnectErrors and Header schemas.
I have tested:
"Accept":"application/xml"
in headers > return byte string xml"Accept":"application/json"
in headers > returns python dict 👍