Skip to content

PathApiVersionResolver should not be nullable #35265

@rstoyanchev

Description

@rstoyanchev

A path based version cannot be optional as its built into the URL path structure and mappings, and therefore it's expected to be in the path, and cannot be optional.

This should be reflected in the implementation, which currently returns null if there is no parsed path (but that's unrelated, PathPattern vs AntPathMatcher, and should be illegal state).

It can also return null if there aren't enough path segments, but should be a bad request. It's a bit random to treat insufficient number of path segments leniently, but enough path segments that are not of the right kind as an bad request (parse exception).

Based on discussion in #35255 (comment).

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions