-
Notifications
You must be signed in to change notification settings - Fork 12
Parse info.version #182
Comments
I made a mistake in my original description, suggesting that version could be removed from the fixtures. Version is required by Swagger, so that is not a viable option. |
I think it probably makes sense that we could contain some kind of source document/version information into the parse result itself. We don't have a specific place for that in API Elements (the parse result format) so will have to give this some though as to where to place it. One note, I don't believe this adapter supports more than one version, only Swagger 2.0 so you can assume the version would be 2.0 for now. |
To be clear, i'm looking for the Thank you for the effort. Parse result is an interesting idea. I hadn't considered it : ) |
For example, in a wrapper I've created to work around this issue I am using the following snippet to add if (this['swagger'].info && this['swagger'].info.version) {
this['api'].meta.set('version', this['swagger'].info.version);
} I'm sure this can be enhanced, and does not handle source map, but it does make the required information available. My attempt at something similar in this project's source broke many swagger-zoo tests because the fixtures do not expect |
Oh sorry, I mis-understood, you are right. I did create apiaryio/api-elements#37 to track the other problem I mentioned. I have the a similar comment though, we will have to decide where to place this in API Elements and then update the parser(s). In your case, the
This information should likely go into the |
Would you like me to make the change in a request so that we can talk about the breaks (if any)? I'm happy to give it a shot. |
This made it into the adapter a few releases ago (https://github.com/apiaryio/fury-adapter-swagger/releases/tag/v0.20.0), forgot to update this issue. |
Hi Team,
I need
info.version
to be available in my parse result. It looks like onlytitle
anddescription
are parsed. I've looked into adding it as meta, liketitle
. Nearly all of the swagger-zoo fixture tests fail due to the fixtures specifying a version which is apparently supposed to be ignored.Is
version
truly supposed to be stripped, as swagger-zoo seems to indicate?CanShould I open an issue/request to swagger-zoo to add the parsed version to the fixtures? If so, is it an attribute, meta, or content?version
be removed from the fixtures (yaml and json) so that this project can parse it additively?Thanks for the consideration : )
The text was updated successfully, but these errors were encountered: