From e97b3a0290e32486d64a17bb4b01f31f656918c6 Mon Sep 17 00:00:00 2001 From: Bogdan U Date: Wed, 21 Aug 2019 09:16:40 +0300 Subject: [PATCH] doc(readme): additional Example for swaggertype (#498) --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index ea98f16c3..40ffd33dd 100644 --- a/README.md +++ b/README.md @@ -567,6 +567,33 @@ type Account struct { } ``` +[#379](https://github.com/swaggo/swag/issues/379) +```go +type CerticateKeyPair struct { + Crt []byte `json:"crt" swaggertype:"string" format:"base64" example:"U3dhZ2dlciByb2Nrcw=="` + Key []byte `json:"key" swaggertype:"string" format:"base64" example:"U3dhZ2dlciByb2Nrcw=="` +} +``` +generated swagger doc as follows: +```go +"api.MyBinding": { + "type":"object", + "properties":{ + "crt":{ + "type":"string", + "format":"base64", + "example":"U3dhZ2dlciByb2Nrcw==" + }, + "key":{ + "type":"string", + "format":"base64", + "example":"U3dhZ2dlciByb2Nrcw==" + } + } +} + +``` + ### Add extension info to struct field ```go