Skip to content

Guide to `codex update`

cguran-ionos edited this page Mar 22, 2023 · 7 revisions

This page is designed to help you propagate spec updates from github.com/ionos-cloud/rest-api to an existing openapi spec baseline.

How do I modify the baseline with the latest api spec changes?

Checklist

  1. Configure target bucket: codex config s3.bucket <s3-bucket-name>
  2. Double-check that all changes are expected: codex update --check -o p1.patch
  3. Ideally add some tests for the new API functionalities https://github.com/ionos-cloud/sdk-resources/tree/master/tests
  4. Update the codex: codex update -o p.patch
  5. Run codex compile to see that the spec is compiled succesfully

You can find the S3 Bucket names here

Note: Undo a codex update

If you notice something broke, you can use the [email protected] account to delete the last baseline version

Checking changes and patches

If a patch is made locally for codex, but a PR is not made to fix it and the team fixes the same problem separately, you can see a difference in baselines. This is normal.

❯ baseline patch level: 0
❯ total patches: 1

You can use codex sdk-changes to see a diff of what is different:

Index: swagger.yaml
===================================================================
--- swagger.yaml
+++ swagger.yaml
@@ -209,8 +209,9 @@
         ## References
     contact:
         url: https://ionos.com
         name: IONOS Cloud
+    x-sdk-patch-level: 1
 externalDocs:
     url: https://api.ionos.com/docs/cloud
     description: IONOS Cloud - API documentation
 servers: