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

bug: typed-enum is incorrectly returning warnings about type #211

Closed
TristanSpeakEasy opened this issue Dec 16, 2022 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@TristanSpeakEasy
Copy link
Contributor

For this doc: https://raw.githubusercontent.com/speakeasy-api/openapi-directory/main/APIs/twitter.com/current/2.21/openapi.yaml

It has an enum at line 1563 that looks like:

enum:
  - media_key
  - duration_ms
  - height
  - preview_image_url
  - type
  - url
  - width
  - public_metrics
  - non_public_metrics
  - organic_metrics
  - promoted_metrics
  - alt_text
type: string

which produces the below errors complaining about "string" defined as "type"

(1563:13)     | warning  | enum type mismatch: enum value 'height' is a string, but it's defined as a 'type'                 | $                                                              
(1563:13)     | warning  | enum type mismatch: enum value 'duration_ms' is a string, but it's defined as a 'type'            | $                                                              
(1563:13)     | warning  | enum type mismatch: enum value 'type' is a string, but it's defined as a 'type'                   | $                                                              
(1563:13)     | warning  | enum type mismatch: enum value 'public_metrics' is a string, but it's defined as a 'type'         | $                                                              
(1563:13)     | warning  | enum type mismatch: enum value 'url' is a string, but it's defined as a 'type'                    | $                                                              
(1563:13)     | warning  | enum type mismatch: enum value 'promoted_metrics' is a string, but it's defined as a 'type'       | $                                                              
(1563:13)     | warning  | enum type mismatch: enum value 'preview_image_url' is a string, but it's defined as a 'type'      | $                                                              
(1563:13)     | warning  | enum type mismatch: enum value 'alt_text' is a string, but it's defined as a 'type'               | $                                                              
(1563:13)     | warning  | enum type mismatch: enum value 'media_key' is a string, but it's defined as a 'type'              | $                                                              
(1563:13)     | warning  | enum type mismatch: enum value 'organic_metrics' is a string, but it's defined as a 'type'        | $                                                              
(1563:13)     | warning  | enum type mismatch: enum value 'width' is a string, but it's defined as a 'type'                  | $                                                              
(1563:13)     | warning  | enum type mismatch: enum value 'non_public_metrics' is a string, but it's defined as a 'type'     | $
@daveshanley
Copy link
Owner

Interesting! working on a fix.

@daveshanley daveshanley self-assigned this Dec 16, 2022
@daveshanley daveshanley added the bug Something isn't working label Dec 16, 2022
daveshanley added a commit that referenced this issue Dec 16, 2022
`libopenapi` was incorrectly extracting enums by looking through everything for a 'type' so when a value had the same name, it got upset. This has now been fixed and vacuum is running `libopenapi` v0.4.6.
daveshanley added a commit that referenced this issue Dec 16, 2022
`libopenapi` was incorrectly extracting enums by looking through everything for a 'type' so when a value had the same name, it got upset. This has now been fixed and vacuum is running `libopenapi` v0.4.6.
@daveshanley
Copy link
Owner

This should be fixed in v0.0.44

@TristanSpeakEasy
Copy link
Contributor Author

can confirm it is fixed

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

No branches or pull requests

2 participants