-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Can't use Custom struct as data type in @Success #181
Comments
Can you give me error source code example? |
Sure, so the exact locations is
The code is running from MyOwnStruct is just a bunch of primitive types with json definitions: type MyOwnStruct struct {
Cp float64 `json:"cp"`
Op float64 `json:"op"`
H float64 `json:"h"`
L float64 `json:"l"`
V float64 `json:"v"`
Nt float64 `json:"nt"`
Ot float64 `json:"ot"`
Ct float64 `json:"ct"`
} I hope this helps. Thanks for the cool library :). |
I was able to reproduce. I'm looking for problems now. |
Do not reference the object as Something like:
.. would be enough to satisfy the importer. |
If You have problem reopen issue. |
I have the same problem, do you have a solution? |
I cannot import any data types, stdlib, external, home rolled, or, defined in-line of the success or failure kwds using swag into my documentation. Is there a solution? Go v1.9 -> 1.12 |
Having same issue with a type defined in the same package:
|
This is invalid for swagger. |
I have the same problem, do you have a solution? |
Describe the bug
I can't use a custom struct as a success response.
To Reproduce
Steps to reproduce the behavior:
@Success 200 {array} path.to.struct.MyOwnStruct
Resolver error at paths./api/path.get.responses.200.schema.items.$ref Could not resolve reference because of: Could not resolve pointer: /definitions/path.to.struct.MyOwnStruct does not exist in document
Expected behavior
I should be able to see in the documentation the structure of
MyOwnStruct
as the case of a successful response.Screenshots

Because it couldn't find the struct this is the result in the swagger documentation
Your swag version
v1.3.2
Desktop (please complete the following information):
Additional context
None
The text was updated successfully, but these errors were encountered: