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

add /filter/validate endpoint #336

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

add /filter/validate endpoint #336

wants to merge 1 commit into from

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