Solved

Download openapi spec in CI

  • 30 November 2023
  • 2 replies
  • 51 views

Trying to download the openapi spec over at https://api-docs.cognite.com/20230101/ by using the URL in the “download” link fails with 404 when trying to use the URL with wget/curl and “ADD” in a dockerfile. It seems like the link is generated behind the scenes during pageload by javascript. Is there a way to download the openapi spec in scripts e.g for use in CI pipelines and similar?

icon

Best answer by kelvin 30 November 2023, 14:43

View original

2 replies

Userlevel 3

Hello! As we are continuously updating our API, relying on the live spec will potentially break things without any obvious reason (we see that parsers of openapi spec are behaving in very different ways). You should rather download it once, check it in, and keep it as part of the controlled environment (i.e. in git) 😊

That is what I am currently doing, but it would be nice to have a nightly job running verifying that the spec is still compatible.

Reply