RepreZen / KaiZen-OpenApi-Parser

High-performance Parser, Validator, and Java Object Model for OpenAPI 3.x
130 stars 31 forks source link

Cannot parse path parameters with $ in their name #259

Open bgilmour opened 3 years ago

bgilmour commented 3 years ago

We're generating OAS specification sources from other sources where it's possible that we'll encounter identifiers with a dollar symbol as part of their name. In some cases these identifiers become path parameters. Consider the following snippet from an OAS specification:

paths:
  /some/path/{x$y}:
    get:
      ...
      parameters:
      - in: path
        name: x$y
        schema:
          type: string
        required: true
        description: Auto generated path parameter

Both the path template and the path parameter definition are accepted by the RepreZen Kaizen OpenAPI editor in Eclipse but the parser rejects the template with a message like the following:

[line:col]: No template for path parameter 'x$y' in path string

This is happening in version 4.0.4 of the parser. We believe that this should be a valid use case although it's perfectly possible that we missed something in the spec that says otherwise.