Open API specification issues

Open API specification issues

Open API specification issues
Open API specification issues
2 weeks ago - last edited Wednesday

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
1 Accepted Solution
Re:Open API specification issues-Solution
2 weeks ago - last edited Wednesday

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.

Recommended Solution
  0  
  0  
#2
Options
6 Reply
Re:Open API specification issues-Solution
2 weeks ago - last edited Wednesday

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.

Recommended Solution
  0  
  0  
#2
Options
Re:Open API specification issues
2 weeks 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
Re:Open API specification issues
Wednesday

Hi  @Tohaker 

 

Thanks for the reply.

 

We will gradually update and optimize this document and synchronize the updates to the link. To ensure accountability to users and maintain network security and stability, we generally don't involve users in testing; we have a dedicated testing team. Nonetheless, we sincerely appreciate your kindness and support.

  0  
  0  
#4
Options
Re:Open API specification issues
Wednesday

  @Vincent-TP 

 

That's great news, thanks for letting me know! Is there any way of knowing when new versions of the spec have been released? Or should I just keep checking regularly?

  0  
  0  
#5
Options
Re:Open API specification issues
Thursday

Hi  @Tohaker 

 

 

Updating documents is time-consuming and effort-intensive, and I cannot specify an exact completion date.

Why do you need to keep checking? Are there any configurations you need to set up via the API now? We can offer configuration recommendations based on your situation.

You can contact the support team to describe your dedicate scenario and requirements. They will provide API configuration suggestions tailored to your specific needs.

  0  
  0  
#6
Options
Re:Open API specification issues
Thursday

  @Vincent-TP 

 

Apologies if my message came across as impatient, I of course understand first-hand how long these kinds of changes can take in large organisations! Please take all the time you need :) 

 

I don't need to keep checking for any functional reason, I'm just keen to remove some of the code in my project that patches these spec issues so my SDK can be clean and complete, and that's a "me problem". It's not a hard requirement and I'm not blocked from working on the Terraform provider.

 

Best wishes to you and the team!

  0  
  0  
#7
Options