infobloxopen / infoblox-swagger-wapi

Swagger documentation for Infoblox grid REST APIs
16 stars 6 forks source link

Can't find valid OpenAPI Specification in this repo #1

Open dotdiego opened 3 years ago

dotdiego commented 3 years ago

Hello,

I'd like to create a REST Client with generated tool from an OpenAPI Specification but none of the files currently on this repository is working.

Can you please update it with valid JSON files ? (None of the files that i've tested in infoblox-swagger-wapi/infoblox-swagger-ui/dist/v2.11/ are valid)

I tried the docker container but same thing, the php is bugged (home.php display wrong form) After editing the php file to get it working, the generated specification is not working either.

So basically this would be fantastic if this was working. Because having an OAS document for Infoblox WAPI would make things easier to produce a rest client.

Thanks

DerPhlipsi commented 3 years ago

Heyo @DIDev1,

the files inside infoblox-swagger-wapi/infoblox-swagger-ui/dist/ are completely valid OpenAPI Spec files. They are however not valid JSON files. Replace all single quotes with double quotes and change True and False to be lowercase. Then you've got a valid JSON that contains a valid OpenAPI3 Spec :)

Greetings, Phil

dotdiego commented 3 years ago

Hello,

How can it be a valid OpenAPI spec if it's not JSON formatted ? Even if the content is a valid specification, the format being wrong, the file is not a valid spec. OpenAPI specification is in JSON or YAML.

With a validator ( https://validator.swagger.io/ ) result is not a Ok/Valid, so this is not a proper OpenAPI specification.

That's why i hope there will be an update on those file as i can't generate them myself.

Regards,

DerPhlipsi commented 3 years ago

Hello,

as I just mentioned in #2, this could be an obfuscation, since this repo contains an application that provides a Swagger UI with the OAS3 spec of the Infoblox WAPI, not the OAS3 spec itself. And sorry for my bad phrasing, yes you are correct, the OAS3 definition requires the data to be valid JSON or YAML, which prevents my text "are completely valid OpenAPI Spec files." from being true. What I meant is that the files contain invalid JSON files which after being treated to conform to JSON-Spec become valid OAS3 Spec files for the Infoblox WAPI.

So if you want to access the OAS3 spec without using the application, you could go the route to do the replacements I wrote erlier in the language of your choice (C# I recon), or you use a service like https://jsonformatter.curiousconcept.com/ that will automatically apply frequent fixes like the ones needed here, but this is just an idea. I've done the latter of the two and now have a working Postman environment as well as autogenerated libraries in multiple languages (with some fixes needed, see #4 for details).

If there will be any barrier free and official access to OAS3 compliant files, I don't know. For this you'll have to wait for an official answer by Infoblox staff. Until then, if you do not want to do the conversion yourself, have a look here.

Greetings, Phil

jeffory-orrok commented 2 years ago

FWIW I posted a message on the community forum a month ago, and today I discovered the openapi files (at least for v2.11) have been regenerated as valid JSON. At the moment, the example and description properties that include embedded stringified JSON are still using single quotes and capitalized booleans, but swagger.io will accept it as valid.