Skip to content

Add a method to nest boolean predicates#2598

Closed
puffnfresh wants to merge 1 commit intospring-cloud:mainfrom
puffnfresh:nest
Closed

Add a method to nest boolean predicates#2598
puffnfresh wants to merge 1 commit intospring-cloud:mainfrom
puffnfresh:nest

Conversation

@puffnfresh
Copy link
Copy Markdown
Contributor

@puffnfresh puffnfresh commented Apr 22, 2022

Spring Cloud Gateway supports complicated boolean predicates like:

(query("a") || query("b")) && (host("x") || host("y))

But lacked a Java API to express this. This new method allows the above:

r.query("a").or().query("b").and().nested(p ->
  p.host("x").or().host("y")
)

Spring Cloud Gateway supports complicated boolean predicates like:

    (query("a") || query("b")) && (host("x") || host("y))

But lacked a Java API to express this. This new methods allows the above:

    r.query("a").or().query("b").and().nested(p ->
      r.host("x").or().host("y")
    )
@pivotal-cla
Copy link
Copy Markdown

@puffnfresh Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-cla
Copy link
Copy Markdown

@puffnfresh Thank you for signing the Contributor License Agreement!

@puffnfresh
Copy link
Copy Markdown
Contributor Author

Sadly org.springframework.cloud.gateway.route.builder.BooleanSpec.Operator is package-private which makes extension of this API impossible.

I don't know about general Spring API design decisions, but I would like to vote for that class to be public.

@spencergibb spencergibb added this to the 4.2.0-M1 milestone Mar 8, 2024
@spencergibb
Copy link
Copy Markdown
Member

spencergibb commented Mar 8, 2024

Scheduled for 2024.0.

See 88b13ed for public BooleanSpec.Operator

@spencergibb spencergibb modified the milestones: 4.2.0-M1, 4.2.0-M2 Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants