Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map is not basic types #784

Closed
kengan opened this issue Aug 31, 2020 · 9 comments
Closed

map is not basic types #784

kengan opened this issue Aug 31, 2020 · 9 comments

Comments

@kengan
Copy link

kengan commented Aug 31, 2020

I add example for map as following

type NameSpaceObj struct {

Name string `json:"Name" example:"testistionamespaces"`

Labels map[string]string   `json:"Labels"  swaggertype:"map,string" example:"istio-injection:enabled"`

}

after running swag init get error as following:
2020/08/31 09:08:34 map is not basic types

can you help me? thank you

@sdghchj
Copy link
Member

sdghchj commented Sep 1, 2020

swaggertype:"map,string" is redundant

@indistinctTalk
Copy link

@sdghchj If you remove that, I get the error of object is unsupported type in example value. Is that correct/intended?

@sdghchj
Copy link
Member

sdghchj commented Sep 1, 2020

@iJebus #683

@kengan
Copy link
Author

kengan commented Sep 6, 2020

@ If you removes waggertype:"map,string" , I get the error of object is unsupported type in example value too.

@sdghchj
Copy link
Member

sdghchj commented Sep 6, 2020

map doesn't support examples

@rogaha
Copy link

rogaha commented Sep 16, 2020

same issue here. what's the recommendation?

@optimistic9527
Copy link

same issue

@linxlunx
Copy link

linxlunx commented Nov 9, 2021

Based on this answer, you should use swaggertype:"object,string"

@ubogdan
Copy link
Contributor

ubogdan commented Jan 18, 2022

Closed: No activity.

@ubogdan ubogdan closed this as completed Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants