Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always include a representation of the resource being worked upon in geoserverx response #80

Open
ricardogsilva opened this issue Jan 3, 2025 · 0 comments
Assignees

Comments

@ricardogsilva
Copy link
Collaborator

Some GeoServer REST API responses do not provide much information about the resource(s) being manipulated.

For example, creating a workspace just returns HTTP 201. Let's strive for providing a useful representation of the resource being worked upon in geoserverx. In this concrete example, our response would include a representation of the workspace that had just been created.

Note that this means we will sometimes need to make more than one request to GeoServer in order to fulfill our task. Going back to the previous example, this would mean that when geoserverx is asked to create a workspace it would need to:

  • Make a first request to GeoServer to create the workspace;
  • Make another request to get back a representation of the newly-created workspace.

We can even implement the code in order to have a lower-level API that mimics GeoServer and would be suited for performance-minded use cases and a normal API that gives back the more useful response. Something like this:

# lower-level API - makes a single HTTP request to GeoServer, returns whatever GeoServer returns
def create_workspace_bare() -> typing.Any:
    ...


# normal API - makes multiple HTTP requests to GeoServer and returns an object
# this calls into the lower-level API functions 
def create_workspace() -> WorkspaceModel:
    ...

This will be mostly applicable for commands that perform creation and editing actions, since in those cases we can imagine it would be most useful for calling code to be given back a representation of the entities being worked upon after GeoServer has committed its changes.

@ricardogsilva ricardogsilva converted this from a draft issue Jan 3, 2025
@ricardogsilva ricardogsilva moved this from Backlog to Todo in geoserverx Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

2 participants