profile
viewpoint

Ask questionsIs `:` a valid delimiter for the path parameter?

Dear OpenAPI specification experts,

I have a question regarding "path pattern" and "path parameters". The questionis whether this path pattern /somePath/{param1}:{param2} is valid.

Let's split the whole "path pattern" (/somePath/{param1}:{param2}) into multiple parts with /, so the original "path pattern" contains two parts:

  1. /somePath
  2. /{param1}:{param2}

Usually, every part contains one parameter like this example /cars/{carId}/drivers/{driverId}, where the {carId} and {driverId} are located in different parts. However, /{param1}:{param2} contains two parameters connected with a delimiter :.

This doc shows how style keyword is related to the delimiters, which does not tell that : is a valid delimiter.

As : is not mentioned as one of the supported delimiters, I would assume, my example is an invalid "path pattern". Could you please share your opinion and maybe point out some docs that I might miss.

Thank you very much in advance.

Best regards, Junjie

OAI/OpenAPI-Specification

Answer questions MikeRalphson

The only delimiters in a URL path are /, ?, & and #. The : character here doesn't function as a delimiter between path segments, nor, as it is not within a path parameter, does it act as part of the name of a parameter, or a delimiter for the purposes of the style keyword.

It is valid to have multiple in: path parameters within one URL path segment, but they may not 'cross' a path segment boundary, by containing an unescaped / character.

Please feel free to update this issue if you think the spec. or examples subdirectory should be updated to make this clearer.

useful!
source:https://uonfu.com/
answerer
Mike Ralphson MikeRalphson Postman, Inc. Newbury. UK http://mermade.github.io My hovercard is full of eels. I will not buy this repository; it is scratched.
Github User Rank List