We currently don’t take that under consideration when generating sample data. 
If you’d like to see it change, please file a ticket with the project.

 

 

From: <[email protected]> on behalf of Krithika Vittal 
<[email protected]>
Reply-To: "[email protected]" 
<[email protected]>
Date: Monday, October 30, 2017 at 11:18
To: Swagger <[email protected]>
Subject: Swagger ignores pattern when creating sample request/response.

 

 

Below is the definition I am using for a request json , 

 

  SampleRequest:

    type: object

    required:

      - version

      - lang

      - origin

      - mobileDeviceIdentifiers

    properties:

      version:

        type: string

        pattern: (\d+\.)(\d+\.)(\d)

      lang:

        type: string

        example: fr

      origin:

        type: string

        example: WEB

      mobileDeviceIdentifiers:

        required:

          - uniqueDeviceID

          - devicePlatform

          - deviceModel

          - deviceOSVersion

        properties:

          uniqueDeviceID:

            type: string

            example: c3877886787

          devicePlatform:

            type: string

            example: Android

          deviceModel:

            type: string

            example: Nexus 5

          deviceOSVersion:

            type: string

            example: '6.0'

    xml:

      name: SampleRequest

 

Swagger documentation does not render a value confirming to the regex 
'(\d+\.)(\d+\.)(\d)' instead the response is just displayed as below,

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Could you please help to resolve ? Thanks.

 

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to