swaggo / swag

Automatically generate RESTful API documentation with Swagger 2.0 for Go.
MIT License
10.63k stars 1.19k forks source link

add pattern or example to string value in a model #1776

Closed jonathan-dev closed 7 months ago

jonathan-dev commented 7 months ago

I there any possibility to add pattern or example information like this

    properties:
      releaseDate:
        type: date
        pattern: /([0-9]{4})-(?:[0-9]{2})-([0-9]{2})/
        example: "2019-05-17"

(https://stackoverflow.com/a/64035263/6938528)

And I also would be interested in setting the format mentioned here

jonathan-dev commented 7 months ago

https://github.com/swaggo/swag/issues/379