Closed chriskelly closed 1 year ago
Hi @chriskelly - not sure what the ask is here? Are you expecting VSCode to lint your YAML? You are generating an OpenAPI spec so not sure what you're expecting VSCode to do with that?
OpenAPI is a spec for defining APIs, its not designed for general purpose YAML linting/validation - for that you just want to define a JSONSchema for your file
@chriskelly, try loading the generated spec into https://editor-next.swagger.io/ . You'll get good feedback there.
Gotcha, think that was a misunderstanding on my part. I am looking for a linting tool and thought I'd need OpenAPI for that. Didn't realize that Pydantic has their own schema generator, so I'll stick with that. Thanks!
I'm new to using custom json schemas (and to YAML in general). I'm trying to use your library (v0.3.1) with Pydantic v2 to provide useful descriptions for my user's yaml files. When I try your example, VSCode recognizes the schema, but nothing else seems to happen. There's no description on hover, no auto-completion suggestions, and no problems are raised if the wrong type is used. Am I making the wrong assumptions about the behavior that's supposed to happen or is there something wrong in my setup?
temporary.py schema creation module:
temporary.json output of temporary.py:
temporary.yml file for testing with defined and undefined parameters:
screenshot showing temporary.json schema selected at bottom:![image](https://github.com/mike-oakley/openapi-pydantic/assets/3745832/5863d78d-a373-408c-8624-b6562b7db4ff)
Redhat YAML extension settings:
![image](https://github.com/mike-oakley/openapi-pydantic/assets/3745832/f35f3c86-74f0-48c1-ac5c-9d05f75c526a)