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 jjtang1985

@MikeRalphson ,

For the "special characters", in addition to the ones mentioned (?, # and %), please fine more examples below, where (, ), ', &, $ are used:

  • /somePath/({param})
  • /somePath/'{param1}'
  • /somePath/{param1}&{param2}
  • /somePath/{param1}${param2}

Best regards, Junjie

useful!
source:https://uonfu.com/
answerer
Junjie Tang jjtang1985 SAP **Disclaimer:** Opinions expressed are solely my own and do not express the views or opinions of my employer.
Github User Rank List