Publish jsonschema with documention

Bug #1917626 reported by Jayson Reis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Undecided
Unassigned

Bug Description

Hey there, I saw that you folks already use jsonschema so I would like to propose to publish together with the docs so IDEs can validate cloudinit files without calling an external service or code.
This is really helpful when you are writing cloud-init files because your schemas are quite rich and have good documentation in them.
I thought of using already existing tox doc to do it but it won't have the dependencies necessary to dump the schemas, do you suggest something there?
To make it work locally, I just generated the schema offline with the following command:
python -c 'import json; from cloudinit.config.schema import get_schema; print(json.dumps(get_schema(), indent=4))'
But if that was online it could be added to https://www.schemastore.org/ which seems to be a central location for a bunch of schemas.
Thank you in advance!

Revision history for this message
Chad Smith (chad.smith) wrote :

Good feature request, our team has talked about this a bit and how we'd like to instrument publishing these versioned docs. This is on our roadmap, but haven't had runway to put this into practice yet. Agree that it's a feature we need to address and as we make progress on that we will update this bug.

Our plan prior to publishing the docs was to round out jsonschema definitions for the 50+ other uncovered cloudinit.config modules, but maybe it's not worth waiting for complete coverage before starting this publishing effort.

Paride Legovini (paride)
Changed in cloud-init:
status: New → Triaged
Revision history for this message
Ayman Bagabas (aymanbagabas) wrote :

Any updates on this? Having a public json schema on https://www.schemastore.org/ would be very handy when writing cloud-init config.

Revision history for this message
James Falcon (falcojr) wrote :

Yes, this is currently in progress. There are a large number of modules to convert and/or build schemas for. As of https://github.com/canonical/cloud-init/pull/1211 , we have a schema definition for modules A-D, https://github.com/canonical/cloud-init/blob/main/cloudinit/config/cloud-init-schema.json . There are no plans to publish this schema to a larger audience (i.e., somewhere like schema store) until all modules are represented in that file.

Changed in cloud-init:
status: Triaged → In Progress
Revision history for this message
Chad Smith (chad.smith) wrote :

Sorry for delay here, this is fix released and published to schema-store.org as of this upstream commit https://github.com/canonical/cloud-init/commit/53e1ccf83ca737f80f98300cf00d5c026bd9464d

Changed in cloud-init:
status: In Progress → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.