gbv / cocoda-sdk

SDK for Cocoda and coli-conc services
https://gbv.github.io/cocoda-sdk/
MIT License
5 stars 1 forks source link

types endpoint is always set despite not configured #20

Closed nichtich closed 3 years ago

nichtich commented 3 years ago

Given a configuration

{
    "provider": "ConceptApi",
    "api": "http://example.org/",
}

_api.types will be initialized with http://example.org/types. Afterwards in https://github.com/gbv/cocoda-sdk/blob/ed206bfa0b970fb7fd35c4aa8a5de170d1cbe11c/providers/base-provider.js#L332-L337 the endpoints are merged with result from /status endpoint. If the latter does not include a types andpoint, the initialized value is kept. Shouldn't /status be the source of truth for endpoints?

stefandesu commented 3 years ago

See #21. If the /status endpoint returns null for a given endpoint, then it will be assumed that it is not available (i.e. it will not be set implicitly). But if /status does not say anything about a given endpoint, it might still be assumed to exist.

jskos-server instances will, starting from the next release (in dev now), return null for the types endpoint (https://github.com/gbv/jskos-server/issues/119).