joolfe / postman-to-openapi

🛸 Convert postman collection to OpenAPI
MIT License
575 stars 99 forks source link

Parameter parsing derives wrong type #207

Closed mindrunner closed 1 year ago

mindrunner commented 1 year ago

The default schema used for parameters is string but the library try to infer the type of the parameters based on the value using regular expressions, the detected types are integer, number, boolean and string, if you find any problem in the inference process please open an issue.

Postman:

"query": [
    {
        "key": "to",
        "value": "2022-06-23T10:00:00.000%2b01:00"
    },
    {
        "key": "from",
        "value": "2021-06-23T10:00:00.000%2b01:00"
    },
],

Results in:

        - name: to
          in: query
          schema:
            type: number
          example: '2022-06-23T10:00:00.000+01:00'
        - name: from
          in: query
          schema:
            type: number
          example: '2021-06-23T10:00:00.000+01:00'

Number should be String

mindrunner commented 1 year ago

awesome, thank you :)