opengeospatial / ogcapi-styles

A Web API that enables map servers, clients as well as visual style editors, to manage and fetch styles.
https://ogcapi.ogc.org/styles
Other
10 stars 5 forks source link

Styles: suggested styleId when creating a style? #38

Open cportele opened 3 years ago

cportele commented 3 years ago

From the discussion in the chat on day 3:

Styles extends on the generic Create/Replace/Delete requirements class, i.e., styles are always created with POST and the server assigns the styleId. The server is free to parse the submitted stylesheet to determine a meaningful styleId, if it wants, but that is not possible in style encodings that do not include an identifier.

Maybe add a HTTP header that clients could use to suggest a styleId with a POST request. The server would be free to ignore the suggestion.

I will see, if such a header is already in use somewhere.

pomakis commented 3 years ago

That seems like an awkward requirement. What's wrong with using HTTP PUT for this? RFC 2616 states (re: HTTP PUT) "If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new resource by the requesting user agent, the origin server can create the resource with that URI.". For example, the CubeWerx implementation accepts an HTTP PUT /styles/{styleId} request to create (or replace) a style with a specific ID.

cportele commented 3 years ago

@pomakis - Maybe talk to your colleague @pvretano 😁? Here is a link to the discussion that resulted in the current requirements: https://github.com/opengeospatial/ogcapi-features/issues/329.

pomakis commented 3 years ago

@cportele, that requirement is specifically for the creation of a new vector feature "since assignment of feature ids is up to the server". There's no such constraint for styles.

cportele commented 3 years ago

@pomakis - No the requirement is from a requirements class that is for create/replace/delete of resources in general (although it sits in Features), there is a separate one in the document that specializes the requirements for feature resources. The rule that only POST is used for create is already in the general class. But, of course, that could be discussed/changed again.

pomakis commented 3 years ago

@cportele, if this is true then this decision definitely needs to be revisited. HTTP PUT is the standard way of allowing a client to create a resource with a client-defined URI. HTTP POST is for situations where the server should assign a URI. Feature IDs are usually server specific, so it makes sense for the creation of a new feature through HTTP POST. But to ban the creation of other OGC API resources through HTTP PUT, and define some other awkward way of allowing the client to indicate the desired ID, would be silly.

cportele commented 3 years ago

Related: https://github.com/opengeospatial/ogcapi-features/issues/595

jeffharrison commented 3 years ago

Note - On 5 Oct 2021 SWG discussed aspects of this Issue. TBC in future sessions.

cportele commented 2 years ago

Meeting 2021-11-02: Wait for the update to the conformance class in Features. Then we will support Create using PUT in Styles.