Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish jsonschema with documention #3850

Closed
ubuntu-server-builder opened this issue May 12, 2023 · 4 comments
Closed

Publish jsonschema with documention #3850

ubuntu-server-builder opened this issue May 12, 2023 · 4 comments
Labels
launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #1917626

Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = 2023-04-19T18:33:00.062146+00:00
date_created = 2021-03-03T13:39:34.977274+00:00
date_fix_committed = 2023-04-19T18:33:00.062146+00:00
date_fix_released = 2023-04-19T18:33:00.062146+00:00
id = 1917626
importance = undecided
is_complete = True
lp_url = https://bugs.launchpad.net/cloud-init/+bug/1917626
milestone = None
owner = jaysonsantos2003
owner_name = Jayson Reis
private = False
status = fix_released
submitter = jaysonsantos2003
submitter_name = Jayson Reis
tags = []
duplicates = []

Launchpad user Jayson Reis(jaysonsantos2003) wrote on 2021-03-03T13:39:34.977274+00:00

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!

@ubuntu-server-builder ubuntu-server-builder added the launchpad Migrated from Launchpad label May 12, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Chad Smith(chad.smith) wrote on 2021-03-05T04:52:36.237412+00:00

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.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Ayman Bagabas(aymanbagabas) wrote on 2022-01-24T17:41:29.213645+00:00

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

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user James Falcon(falcojr) wrote on 2022-02-01T17:49:00.931980+00:00

Yes, this is currently in progress. There are a large number of modules to convert and/or build schemas for. As of #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.

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Chad Smith(chad.smith) wrote on 2023-04-19T18:32:56.587562+00:00

Sorry for delay here, this is fix released and published to schema-store.org as of this upstream commit 53e1ccf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
launchpad Migrated from Launchpad
Projects
None yet
Development

No branches or pull requests

1 participant