jhthorsen / mojolicious-plugin-openapi

OpenAPI / Swagger plugin for Mojolicious
54 stars 42 forks source link

matching of '.' in path template #157

Closed rmallah closed 4 years ago

rmallah commented 4 years ago

Hi

looks like its not possible to match the complete data in path templates.

consider below fragment

/master/child_places/{geo_id}:
    get:
      tags:
      - masters
      summary: provides list of all countries
      operationId: searchPlaces
      "x-mojo-to": "API#child_places"
      description: |
        This API endpoint searches for countries in platform and returns matching country names.
      produces:
      - application/json

      parameters:
        - name: geo_id
          in: path
          description: the parent place whould child places are to be found.
          required: true
          type: string

if geo_id has a '.' in it , then only the part before the dot is matched. eg if /master/child_places/US.MD is requested then $c->param('geo_id') will only get 'US' not 'US.MD'

jhthorsen commented 4 years ago

Look for "x-mojo-placeholder" in https://metacpan.org/pod/distribution/Mojolicious-Plugin-OpenAPI/lib/Mojolicious/Plugin/OpenAPI/Guides/Tutorial.pod

Maybe you want to join #perl-openapi on https://freenode.net/ to get support, instead of creating issues?

rmallah commented 4 years ago

Hi Thanks . Sorry for the unnecessary issue. But thanks again for the quick response :smiley:
I will join the irc too.