Skip to content

fix(docs): improve swagger output by setting swaggertype and enums #705

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

Merged
merged 3 commits into from
May 13, 2025

Conversation

capriolo
Copy link
Contributor

Added swaggertype:"string" and enums tags to fields in ProjectView to ensure correct type representation in Swagger docs.

Affected fields:

  • ViewKind
  • Filter
  • BucketConfigurationMode

Added `swaggertype:"string"` and `enums` tags to fields in ProjectView to ensure correct type representation in Swagger docs.

Affected fields:
- ViewKind
- Filter
- BucketConfigurationMode

// The filter query to match tasks by. Check out https://vikunja.io/docs/filters for a full explanation.
Filter *TaskCollection `xorm:"json null default null" query:"filter" json:"filter"`
Filter *TaskCollection `xorm:"json null default null" query:"filter" json:"filter" swaggertype:"string"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not a string, it's a subtype

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kolaente Hey, It seems to be a subtype but for some reason in API it returns a string:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been changed a while ago, which version are you using?

Here's ther response from the demo (which runs unstable):

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on the stable (v0.24.6) version.
I removed swaggertype for this field

@kolaente kolaente enabled auto-merge (squash) May 13, 2025 10:45
@kolaente kolaente merged commit 1d38306 into go-vikunja:main May 13, 2025
20 checks passed
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

Successfully merging this pull request may close these issues.

2 participants