conda / conda/constructor

Publish schema someplace more predictable/cached

Open
#1,016 2 comments 0 reactions 0 assignees View on GitHub
type::documentation
Dominant language
Python
Stars
497
Forks
181
Avg merge
1d 16h
Merged PRs (30d)
17

Description

### Checklist

- [x] I added a descriptive title
- [x] I searched open reports and couldn't find a duplicate

### What happened?

As always, thanks for `constructor`, and congrats on 3.12! :tada:

The next piece of the schema puzzle is publishing the JSON someplace that has a versioned URL, and broadly available, making it more it reliable for use in downstream tools. `raw.githubusercontent` is _not_ a great spot, long term, as different users/instutions can be firewalled/ratebanned for various reasons, and requires some tricks to even cache locally.

The first place which _might_ make sense is along with the docs: this could be as simple as adding `../../constructor/data` to `html_static_paths`, which would make it available in `/_static/construct.schema.json`. However, GitHub pages _doesn't_ allow for multiple deploys versioning, so to get proper versioning, this would probably have to be a more complex approach which e.g. restored the schema for all historic versions from git for publishing.

Another path would be to (also) publish docs on `readthedocs.org`, which would give basically free versioning as a URL prefix (in addition to a number of other features), though there is, as usual, some integration risk.

Parallel to all of _that_: getting a URL added to the [schema store](https://github.com/schemastore/schemastore/) would give users of willing tools (such as `yaml-language-server`) a zero-configuration approach without magic comments: one can _already_ add this to `construct.yaml` and start getting completion, hover information, etc.

```yaml
#yaml-language-server $schema=https://github.com/conda/constructor/raw/refs/tags/3.12.0/constructor/data/construct.schema.json
```

This would generally need an "evergreen" URL (e.g. `latest`), which complicates matters a bit further.

Thanks again!

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.