Skip to content
This repository was archived by the owner on Oct 3, 2020. It is now read-only.
This repository was archived by the owner on Oct 3, 2020. It is now read-only.

Path parameters converted to integers #13

@HeliosAnavatis

Description

@HeliosAnavatis

Fairly new to Python and Connexion.

I have a definition:

  - in: path
    name: orgid
    schema:
      type: string
    required: true
    description: ID of the organisation

and the function that provides information on this URL:
def getOrgById (schemeid,orgid):

Some organisation ids are all numeric. I can convert them to a string, and that's fine but if the organisation id starts with a '0', it gets lopped off.
/organisations/1234
is OK but
/organisations/0563
breaks - because the value of orgid in the function is '563' .

How can I ensure that the parameter is passed to the function as a string and not an integer? Specifying it as a string in the YAML ought to be enough, I'd have thought.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions