Open API specification issues

Open API specification issues

Open API specification issues
Open API specification issues
Sunday

Hi Omada team,

 

First of all, I want to show my appreciation for the Omada Open API, I think the team have done a brilliant job documenting it so well online.

 

I'm aiming to consume the OpenAPI spec to automatically generate a Golang SDK and a Terraform provider for the platform, all open source and MIT licensed. This is something I personally want to use, and have seen at least one other too (https://community.tp-link.com/en/business/forum/topic/850008?moduleId=2692). In my line of work, the best way to get something done is to do it yourself!

I have found some issues, however, with the spec available at https://use1-omada-northbound.tplinkcloud.com/v3/api-docs/00%20All (you may not want to click that link in a browser, it's about 5MB in size!). Notably;

  1. There are about 65 instances where a path parameter is listed in the path, but missing in the parameter list. Many times this is the `omadacId` value that's required for all operations.
  2. There are 4 instances where extra path parameters are specified, but aren't present in the path.
  3. Nearly, if not all (2185) response content blocks list `*/*` as the content type, when this is almost always supposed to be `application/json`.
  4. Some operationIds are misleading. For example, the operation `getGatewayInfo` does not correspond to the `Get gateway info` summary, but to the `Get gateway template info`.

 

TL;DR - when I pass your OpenAPI spec into a tool like github.com/oapi-codegen/oapi-codegen then I am met with many errors and cannot generate a reliable SDK for use. 

At present time, I've created this repo with some tools to overwrite the issues with the spec and generate a useable SDK so I can continue my work. As this is kinda bodged together with duct tape and chewing gum (and a lot of AI generated code), I'd really appreciate it if the spec could be updated to address these issues. I am very happy to work with your engineering team to test updates and provide other feedback, if so desired.

Thanks for your time, 

Miles

  0      
  0      
#1
Options
2 Reply
Re:Open API specification issues
Thursday

Hi  @Tohaker 

 

 

Thank you for taking the time to provide these suggestions. 

We are continuously optimizing the OpenAPI documentation, and I will forward your suggestions to the relevant team.

 

Do you currently have any specific OpenAPI configuration issues? If so, please let us know, and we will provide corresponding advice.

  0  
  0  
#2
Options
Re:Open API specification issues
23 hours ago

Hi  @Vincent-TP 

 

Thanks for taking a look. If it helps the team, I also found using the slightly-more-official https://github.com/openapitools/openapi-generator gives the same result but also a comprehensive list of all errors with the spec. You can run this one command to get them all against the current spec version;

 

docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate -i https://use1-omada-northbound.tplinkcloud.com/v3/api-docs/00%20All -g go -o /local/out/go

 

Apart from that, the actual API works fine. I'll continue working against my local fixed copy, but I'd be happy to test any fixed specs your engineers would like to send my way.

  0  
  0  
#3
Options