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

Invalid Enum Syntax #548

Closed
cnizzardini opened this issue May 15, 2024 · 0 comments · Fixed by #549
Closed

Invalid Enum Syntax #548

cnizzardini opened this issue May 15, 2024 · 0 comments · Fixed by #549
Labels
bug Something isn't working

Comments

@cnizzardini
Copy link
Owner

cnizzardini commented May 15, 2024

Describe the bug

Enum properties are showing as "Structural error" in swagger editor

To Reproduce
Create an enumerated type in your database and create a route for it. The enum is produced incorrectly:

                  the_model:
                    items:
                      type: object
                      properties:
                        an_enum_property:
                          type: string
                          enum:
                            Value: Value
                            Value2: Value2

Expected behavior

                  the_model:
                    items:
                      type: object
                      properties:
                        an_enum_property:
                          type: string
                          enum:
                            - Value
                            - Value2

Attachments
If applicable, add screenshots or swagger.json

Version and Platform (please complete the following information):

  • OS/Platform: Ubuntu 22
  • CakePHP: 5
  • SwaggerBake Version: 3

Additional context

Enums need to be returned after being filtered through array_values

@cnizzardini cnizzardini added the bug Something isn't working label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant