OpenAPI.Document is not a discriminated union and I wish it was one
bug
### What happens?
Per #157 this is kind of a feature request, but discussions aren't turned on.
When I run a document through `deference` or `upgrade`, I get the `OpenAPI.Document` type. This type contains a bunch of union fields, like `.paths` is a union between all possible paths types:

It'd be ideal to:
- Have this type be a discriminated union based on the value of `.openapi`
- Have `upgrade` return a v3.1 type, because it should always be upgrading to that
As it is, it's tricky to work with the types because they are too flexible.
### What did you expect to happen?
These types would be discriminated
### How can we reproduce the issue?
…
### Swagger/OpenAPI Example
http://
关闭于 2024-07-23 2 条评论