opengeospatial / ogcapi-records

An open standard for the discovery of geospatial resources on the Web.
https://ogcapi.ogc.org/records
Other
56 stars 26 forks source link

Use "linkTemplate" rather than "link-template" in JSON. #323

Closed pvretano closed 6 months ago

pvretano commented 6 months ago

From @jerstlouis ...

@pvretano @cportele Since this affects all the SWGs, could we adopt someting else than link-template because that does not follow the decision to avoid hyphens - in JSON property names. The Common guidance was to use camelCase for JSON property names, kebab-case for query parameters, although the final decision was not fully documented in this issue.

Potentially something shorther like tref or just template could be considered too, since this is already inside a template object? In DGGS we used tref so far:

opengeospatial/ogcapi-discrete-global-grid-systems@59b2a1c

pvretano commented 6 months ago

@jerstlouis at the last SWG meeting it was mentioned that we use "link-template" in order to comply with the proposed link template header field. Given this desire, I don't think tref or template will cut it. linkTemplate would be fine with me. In any case, I will raise all of this at the next SWG meeting. Can you provide the reference to the guidance about using lower camel case property names in JSON?

jerstlouis commented 6 months ago

@pvretano The Link-template: header field is somewhat analogous to the Link: header.

The Link: header (multiple of which can be received) translates into the links property which is an array of Link JSON structures, with an href inside of it.

The Link-Template: header translates in the new proposal to the linkTemplates property (hopefully without the hyphen) which is an array of LinkTemplate JSON structures, so we could still call the member with the actual URL inside of it tref or href or template -- we don't really need to repeat link-template or linkTemplate inside of it again.

The Common issue about casing rules is this one: https://github.com/opengeospatial/ogcapi-common/issues/224 .

I added a comment about fully clarifying / resolving it.

cportele commented 6 months ago

@jerstlouis is correct about the use of lowerCamelCase (which is why we also use varBase instead of var-base).

I worked on a pull request for Features yesterday and there I used uriTemplate since this is what the value is. It becomes a link template only through the additional link attributes.

We could shorten it to template. It clearly is not a hypertext reference, so it should not be href. tref does not make sense to me, it is a template, not a template reference. If template is considered too long (is it?), we could shorten it to tmpl or something like that.

jerstlouis commented 6 months ago

@cportele

tref or thref could potentially be read as a templated (hypertext/link) reference :)

It has been used before as an additional attribute to <link> in MapML: https://maps4html.org/web-map-doc/docs/elements/link/#tref . I don't recall if I've seen this used elsewhere.

I would be happy with any of uriTemplate, linkTemplate, template, turi, tmpl, tref, thref, though uriTemplate and linkTemplate are a bit long.

As long as there are no dashes ;)

kalxas commented 6 months ago

Any of linkTemplate, uriTemplate are good for me. I think we have enough consensus here not to wait for the next meeting to make the change.

tomkralidis commented 6 months ago

+1 for linkTemplate.

jerstlouis commented 6 months ago

Since as @cportele says:

It becomes a link template only through the additional link attributes.

I would prefer uriTemplate over linkTemplate.

pvretano commented 6 months ago

I'm ok with uriTemplate or linkTemplate ... although I think I now prefer uriTemplate. @tomkralidis, you OK with uriTemplate?

tomkralidis commented 6 months ago

Assuming https://github.com/opengeospatial/ogcapi-features/pull/876 is approved/merged, I"m fine with uriTemplate as well.