Is there any REST API / DSL request standard for expressing complex filters in a GET URL?

I'm currently exploring an elegant way to design my REST API to display filters for GET requests returning collections. I would like to express the queries as " http: // [...]? Filter = expressions ", where I am going to evaluate some of the expressions. Do I have the feeling that a flexible approach will necessitate a simple DSL request? Closest to the good formal specification that I have found so far,

http://www.juniper.net/techpubs/en_US/junos-space-sdk/13.1/apiref/com.juniper.junos_space.sdk.help/html/reference/Commonbehav.html#step8

I was wondering if ANTLR is a tool to look at? But since this should be such a general necessity, I was wondering if there is any REST API standard DSL request available?

A bit confusing greetings and thanks for input :)

+6
source share
2 answers

OData 4 ( http://www.odata.org/ ) has a very complete query syntax and supports the ER data model with navigation, filtering, expressions, etc. The MSFT Azure AD Graph API is based on OData. The only drawback is that the full specification is pretty deep. There are several open source versions, Apache Olingo ( http://olingo.apache.org/ ), which is one with support for Java clients and servers. There are others.

+3
source

I just stumbled upon QueryDSL , which provides reliable builders for queries on a number of backend technologies.

I'm not sure I like the idea of ​​matching the runaway builder directly with query parameters, but this approach is discussed in two blogs on the QueryDSL website .

+1
source

Source: https://habr.com/ru/post/982761/


All Articles