Skip to main content
Solved

Download openapi spec in CI


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?

Best answer by kelvin

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) 😊

View original
Did this topic help you find an answer to your question?

2 replies

kelvin
Seasoned Practitioner
  • Seasoned Practitioner
  • 53 replies
  • Answer
  • November 30, 2023

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) 😊


  • Author
  • Active
  • 1 reply
  • November 30, 2023

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


Cookie Policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings