Hi there. I'm new to Swagger, and converting existing API specs from another format to Swagger JSON (programatically).
1)
https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#path-item-object says all the fixed fields (HTTP verbs) are
Operation Object types, so my prototype object had them as null values. When you do that, the swagger UI hangs with the "Can't read from server. It may not have the appropriate access-control-origin settings." result, or "fetching resource list: ..." depending on other contents in the file. If they are empty strings, it's happy. Oh, and I also get the CORS message if the JSON is malformed in any way.
2) If I have a parameter with an enum field in it, no matter the value, the UI doesn't show the normal value field. Enum seems to override it. Which means I can't include it in a parameter prototype.
My question is: What are best practices for formatting Swagger JSON? Should I be able to safely include all fields, or do I need to custom emit objects, omitting anything not used? The two issues above seem like bugs to me, but I thought I'd ask.
Cheers.