udata icon indicating copy to clipboard operation
udata copied to clipboard

Filter out datapackage schema

Open maudetes opened this issue 1 year ago • 3 comments

Close https://github.com/etalab/data.gouv.fr/issues/1148

Add an IGNORED_SCHEMA_TYPES variable to ignore some schema types (datapackage). Felt more secure to have an exclude instead of an include logic.

:warning: The front filter doesn't use the /schema route. Instead it loads the catalog directly with getCatalog: https://github.com/etalab/udata-front/blob/38ed004ebb5df3dd2f93c749d25b0ff1e0440975/udata_front/theme/gouvfr/assets/js/components/search/schema-filter.vue#L33C11-L33C11.

  • [ ] We need to use the /schema endpoint from the front

maudetes avatar Aug 18 '23 11:08 maudetes

⚠️ The front filter doesn't use the /schema route. Instead it loads the catalog directly with getCatalog

We can call the datasets/schemas endpoint on the front side but for now we're using the schema_type to know if we should show a validation url and the schema_url from a schema version to make the validata URL.

We can update this logic if there is a better way to get the validata URL, or add the required informations in the endpoint.

nicolaskempf57 avatar Dec 21 '23 09:12 nicolaskempf57

That's a good point! Should we add schema_url and schema_type to the endpoint? It would seem like a useful information to expose in any case

maudetes avatar Jan 03 '24 16:01 maudetes

After taking a look at calls on api/1/datasets/schemas/ endpoint, seems like no external users use this API. We should indeed modify it to expose additional schema urls

{
    "id": "etalab/schema-irve-statique",
    "label": "IRVE statique",
    "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve-statique/latest/schema-statique.json",
    "schema_type": "tableschema",
    "versions": {
        "version_name": "2.2.0",
        "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve-statique/2.2.0/schema-statique.json"
    }
}

maudetes avatar Jan 17 '24 10:01 maudetes

After taking a look at calls on api/1/datasets/schemas/ endpoint, seems like no external users use this API. We should indeed modify it to expose additional schema urls

{
    "id": "etalab/schema-irve-statique",
    "label": "IRVE statique",
    "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve-statique/latest/schema-statique.json",
    "schema_type": "tableschema",
    "versions": {
        "version_name": "2.2.0",
        "schema_url": "https://schema.data.gouv.fr/schemas/etalab/schema-irve-statique/2.2.0/schema-statique.json"
    }
}

Still no external user for this endpoint? Can we break it?

ThibaudDauce avatar Mar 14 '24 08:03 ThibaudDauce

Feature added in this PR https://github.com/opendatateam/udata/pull/2989

ThibaudDauce avatar Mar 14 '24 09:03 ThibaudDauce

Still no external user for this endpoint? Can we break it?

I confirm this. It hasn't been used in the last days outside of our own admin calls.

maudetes avatar Mar 15 '24 08:03 maudetes

Closing it for https://github.com/opendatateam/udata/pull/2989

ThibaudDauce avatar Apr 04 '24 10:04 ThibaudDauce