Skip to content

Conversation

tyrasd
Copy link
Member

@tyrasd tyrasd commented Nov 15, 2024

Description

Adds a new endpoint /filter/validate which tests a provided ohsome filter string for syntax correctness.

Examples:

Request: GET http://127.0.0.1:8083/filter/validate?filter=foo=bar
Response: HTTP 200, body: foo=bar

Request: GET http://127.0.0.1:8083/filter/validate
Response: HTTP 400, body: {…, "status": 400, message: "No filter parameter provided.", … }

Request: GET http://127.0.0.1:8083/filter/validate?filter=type:
Response: HTTP 400, body: {…, "status": 400, message: "Invalid filter syntax. … Detailed error message: line1, column 6: … expected, EOF encountered.", … }

Request: POST http://127.0.0.1:8083/filter/validate, body: filter=foo%3Dbar%26bar
Response: HTTP 200, body: foo=bar

Request: POST http://127.0.0.1:8083/filter/validate, body: <empty>
Response: HTTP 400, body: {…, "status": 400, message: "No filter parameter provided.", … }

Request: POST http://127.0.0.1:8083/filter/validate, body: filter=filter=type%3A
Response: HTTP 400, body: {…, "status": 400, message: "Invalid filter syntax. … Detailed error message: line1, column 6: … expected, EOF encountered.", … }

This endpoint is currently considered "experimental" and therefore not listed in the documentation or the swagger ui.

Checklist

(currently undocumented / unlisted in swagger ui)
@tyrasd tyrasd added the enhancement New feature or request label Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant