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

[ ] string type can't be found if used with replace in .swaggo file. #1320

Closed
Vishvajeet590 opened this issue Sep 6, 2022 · 0 comments
Closed

Comments

@Vishvajeet590
Copy link

Describe the bug
Using replace to replace pq.StringArray to []string is not working.

To Reproduce
Steps to reproduce the behavior:

  1. Add replace pq.StringArray []string in .swaggo file.
  2. Run swag init

Expected behavior
It should not thow error : cannot find type definition: []string and produce response with a string array

Your swag version
Latest
Your go version
e.g. 1.8

Desktop (please complete the following information):

  • OS: Fedora
FabianMartin added a commit to FabianMartin/swag that referenced this issue Sep 12, 2022
- Detect array type and transform schema into spec.ArrayProperty if needed

fixes swaggo#1318, swaggo#1320
ubogdan pushed a commit that referenced this issue Sep 15, 2022
* fix: Generic Fields does not handle Arrays in the .swaggo file

- Detect array type and transform schema into spec.ArrayProperty if needed

fixes #1318, #1320

* refactor: use existing code to parse new type definition

- use methods from Operation to get schema
- methods parseObjectSchema and parseCombinedObjectSchema disconnected from struct
@ubogdan ubogdan closed this as completed Sep 17, 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

2 participants