connexion-example
connexion-example copied to clipboard
Path parameters converted to integers
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.