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 an implementation metadata file suitable for use by json-schema.org #1408

Conversation

adwait-godbole
Copy link
Contributor

@adwait-godbole adwait-godbole commented Aug 6, 2024

Fixes #1312

@Julian can you review this one so that we can get this file available to @benjagm ASAP. Also earlier you had told me to remove the .json extension from the file, are you still ok with that ? Removing that extension directly downloads the file onto your desktop rather than opening on the Bowtie website.


📚 Documentation preview 📚: https://bowtie-json-schema--1408.org.readthedocs.build/en/1408/

@adwait-godbole
Copy link
Contributor Author

Also @benjagm what all keys do you expect to be included in this API corresponding to an implementation?

@Julian
Copy link
Member

Julian commented Aug 6, 2024

Removing that extension directly downloads the file onto your desktop rather than opening on the Bowtie website.

Only if you view it in a browser, for API consumption it doesn't matter either way. (So yes let's remove it).

I'm confused though., didn't we merge this already? Having a look.

@adwait-godbole
Copy link
Contributor Author

I'm confused though., didn't we merge this already? Having a look.

Nah we didn't. I had that PR opened but later closed it. This

@Julian
Copy link
Member

Julian commented Aug 6, 2024

Also @benjagm what all keys do you expect to be included in this API corresponding to an implementation?

Looks like Benja shared what's expected here -- so all we need is a mapping where the keys are source URLs for implementations, and the values should have:

  • bowtie's ID (e.g. python-jsonschema)
  • the dialects key.
  • the badges URLs

We can skip everything else for now.

(EDIT: Also the badges URLs, as we may as well simply include that so that the JSON Schema folks don't need to recalculate it).

@adwait-godbole
Copy link
Contributor Author

Doing the changes.

@adwait-godbole
Copy link
Contributor Author

adwait-godbole commented Aug 6, 2024

the badges URLs

@Julian Is there a way of generating those URLs programmatically using bowtie 😅? Otherwise will again have to write YAML logic for it.

@adwait-godbole adwait-godbole changed the title Public Implementations API for JSON Schema Org Implementations API for JSON Schema Org Aug 6, 2024
@Julian
Copy link
Member

Julian commented Aug 6, 2024

I think that logic lives in the UI code unfortunately right now which I think you've seen last -- so not directly -- you could have a small typescript script maybe which imports the UI file, but not sure that's simpler than doing the hairy thing again :/

@Julian Julian changed the title Implementations API for JSON Schema Org Publish an implementation metadata file suitable for use by json-schema.org Aug 6, 2024
@adwait-godbole
Copy link
Contributor Author

@Julian made the final changes. Tested on my local works fine.

You can have a look here --> https://adwait-godbole.github.io/bowtie/api/v1/json-schema-org/implementations

@Julian
Copy link
Member

Julian commented Aug 7, 2024

Thanks! Let's give it a shot. Well done.

@Julian Julian merged commit 4359758 into bowtie-json-schema:main Aug 7, 2024
25 checks passed
@adwait-godbole
Copy link
Contributor Author

It would be better if you could manually trigger this workflow once the CI passes, so we know if it works or not.

@Julian
Copy link
Member

Julian commented Aug 7, 2024

I kicked a release!

@adwait-godbole
Copy link
Contributor Author

I hope for e.g. the below output format is fine right ?

  "https://github.com/tdegrunt/jsonschema": {
    "id": "js-jsonschema",
    "dialects": [
      "http://json-schema.org/draft-07/schema#",
      "http://json-schema.org/draft-06/schema#",
      "http://json-schema.org/draft-04/schema#",
      "http://json-schema.org/draft-03/schema#"
    ],
    "badges_urls": {
      "supported_versions": "https://bowtie.report/badges/javascript-jsonschema/supported_versions.json",
      "dialects_compliance": {
        "draft7": "https://bowtie.report/badges/javascript-jsonschema/compliance/draft7.json",
        "draft6": "https://bowtie.report/badges/javascript-jsonschema/compliance/draft6.json",
        "draft4": "https://bowtie.report/badges/javascript-jsonschema/compliance/draft4.json",
        "draft3": "https://bowtie.report/badges/javascript-jsonschema/compliance/draft3.json"
      }
    }
  }

@Julian
Copy link
Member

Julian commented Aug 7, 2024

Ah, close, I think ideally the keys in the dialects_compliance badges should be dialect URIs, otherwise there's no way for someone to know the short names of dialects (we "invented" them even though they're basically what everyone uses). Can you make that tweak?

@Julian
Copy link
Member

Julian commented Aug 7, 2024

Probably you can also shorten the key name to compliance to match the URI, rather than dialects_compliance.

@adwait-godbole
Copy link
Contributor Author

Yup makes sense!

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

Successfully merging this pull request may close these issues.

Publish a JSON File with all the implementations details suitable for consumption by json-schema.org
2 participants