Swag: Support readOnly attribute

Created on 18 Sep 2019  路  3Comments  路  Source: swaggo/swag

It would be great to have readOnly: true supported as a model attribute:

type Car struct {
    ID string `json:"id" readOnly:"true"` // <----
    Name string `json:"name"`
}
feature

Most helpful comment

I would like to have the same feature. I created a pr and added the read only to one of the tests. Let me know if it suffice.

All 3 comments

Looks like "readOnly" attribute it's OpenAPI 2.0 compliant.
I will like to do PR for it but I'm quite busy in this period .
If you really need this feature and you have some time please contribute to swag by writing a PR.

I would like to have the same feature. I created a pr and added the read only to one of the tests. Let me know if it suffice.

Your PR was approved . Thanks for contributing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

padurean picture padurean  路  6Comments

fannheyward picture fannheyward  路  3Comments

chiragg6 picture chiragg6  路  7Comments

lfaoro picture lfaoro  路  4Comments

LennyPenny picture LennyPenny  路  4Comments