tamasfe / taplo

A TOML toolkit written in Rust
https://taplo.tamasfe.dev
MIT License
1.35k stars 114 forks source link

Support for [project] key in schema validation #646

Open KyleMit opened 1 month ago

KyleMit commented 1 month ago

When I have the following in my pyproject.toml

[project]
name = "jsonschema"

[project.urls]
Homepage = "https://github.com/python-jsonschema/jsonschema"

I get the following error message:

{"name":"jsonschema","urls":{"Homepage":"https://github.com/python-jsonschema/jsonschema"}} 
is not valid under any of the given schemas 
Even Better TOML

image

But this follows the python spec Declaring project metadata: the [project] table and very common examples

Can the schema validation be updated to allow for this key?

panekj commented 1 month ago

What schema is currently present in your file? (You can check that in right bottom corner next to file language type)

KyleMit commented 1 month ago

Initially it was set to no schema selected

image

But I've updatd to each of the PyProject

image

Actually, looks like it might be related to the json schema store file - https://json.schemastore.org/pyproject.json

And probably need to open an issue/PR there

https://github.com/SchemaStore/schemastore/blob/6d4407c3185f5d956a932fcce111f3f926c319f0/src/schemas/json/pyproject.json#L298-L310

panekj commented 1 month ago

If the schema has been set on the file (it shows up as PyProject in bottom right corner) then it's likely an issue with schema. Otherwise it could be because of https://github.com/tamasfe/taplo/issues/624