Code-generating NGPVAN API client. #751
Labels
enhancement
Impact - something should be added to or changed about Parsons that isn't causing a current breakage
low priority
Priority - this is a nice-to-have, is non-urgent, and/or has a minor overall imapact on Parsons
NGPVAN appears to use the Swaggar / OpenAPI spec to generate their documentation with readme.com. This means that if we could find access to the swaggar.json (e.g. the spec for their docs), we could use code generation tools (1, 2, 3) to automatically produce a Python API client for NGPVAN.
Detailed Description
I spent some time seeing if there was some way that I could scrape the NGPVAN API from the website. Using Chome Devtools, I was able to find snippets of JSON of the API spec per each endpoint. Due to a cross-site-origin header, I was unable to script out a way to get the specs en mass.
However, I noticed a strange pattern in their readme generated docs – namely this code:
Looking further, I found that
api
is an npm library that makes use of the swagger api spec for the node SDK. By reverse engineering this library, I could probably get access to the swagger spec that NGPVAN has not made available.Indeed, this line of code reveals what that junk is at the end of the string above:
https://github.com/readmeio/api/blob/a9c6ce28b3bcb6981e2135180c19f39ef6f025af/packages/api/src/fetcher.ts#L24
Thus, the URL for the swagger spec for NGPVAN is: https://dash.readme.com/api/v1/api-registry/5r6sg7sl74xoc30
Context
Code-generating an Python API Client has several benefits:
It's worth saying, code-generation comes with tradeoffs, too:
Possible Implementation
Priority
low priority -- this is more of an R&D project :)
The text was updated successfully, but these errors were encountered: