Comments (5)
Definition for github.com/getkin/kin-openapi/openapi3.Types
is here:
https://pkg.go.dev/github.com/getkin/[email protected]/openapi3#Types
Definition for Schema.Type
is as follows:
v0.124.0
Type *Types `json:"type,omitempty" yaml:"type,omitempty"`
Types
is a []string
:
type Types []string
https://pkg.go.dev/github.com/getkin/[email protected]/openapi3#Schema
v0.123.0
Type string `json:"type,omitempty" yaml:"type,omitempty"`
https://pkg.go.dev/github.com/getkin/[email protected]/openapi3#Schema
from spectrum.
Upstream merge links:
Additional discussion links:
- mattpolzin/OpenAPIKit#356
- OpenAPI Specification plugin erroneously requires schema type field to be an array when OpenAPI version is 3.1.0 youtrack.jetbrains.com/issue/IJPL-63311
from spectrum.
Spec discussion:
In OpenAPIv3.0 type can only take a single string value per https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#properties
In OAS 3.0.3:
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#properties
The following properties are taken from the JSON Schema definition but their definitions were adjusted to the OpenAPI Specification.
- type - Value MUST be a string. Multiple types via an array are not supported.
This is no longer the case in OAS 3.1.0.
This issue:
Mentions this YAML impelmentation:
'Legal in v2':
type: [boolean, string]
'Legal in v3.0':
oneOf:
- {type: boolean}
- {type: string}
from spectrum.
It is best to validate that downstream tools like OpenAPI Generator, Docusaurus, Redoc and others behave as expected given use of oneOf
.
from spectrum.
oapi-codegen
PR changes for reference: https://github.com/oapi-codegen/oapi-codegen/pull/1532/files
from spectrum.
Related Issues (12)
- undefined: stringsutil.SliceTrimSpace HOT 4
- Handle merging different base paths HOT 1
- Breaking changes in `kin-openapi` v0.120.0 - upgrade Go min version to 1.20 HOT 1
- From postman to swagger? HOT 1
- Migrate to github.com/rbretecher/go-postman-collection HOT 1
- Breaking changes in `kin-openapi` v0.122.0 - change of map definitions HOT 3
- Breaking changes in `kin-openapi` v0.61.0 - change name of primary struct HOT 1
- Add oas3lint rules
- Add oas3lint filters HOT 1
- Support converting OpenAPI 2.0 examples HOT 1
- Build error - specMaster.Tags undefined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spectrum.