Comments (9)
Reopening, because current implementation does not work with allOf
, oneOf
:|
from openapi_first.
@ahx Good to know! We've actually adopted the type: ['null',string]
already even though it's not officially supported. But we'll probably be upgrading to 3.1 soon.
from openapi_first.
json_schemer is currently not a good place to impement something like that.
Here's an idea for a new rubygem:
require 'openapi-json-schema-converter'
OpenapiJsonSchemaConverter.new(openapi_json_schema).call(data) # => standard_json_schema
from openapi_first.
@ahx
FYI this is a workaround we found:
some_thing:
oneOf:
- type: 'null' # Note the quotes around 'null'
- type: string
which could be improved once OpenAPI 3.1 (#46) is supported to:
some_thing:
type: ['null',string]
so does this even need to stay open?
from openapi_first.
type: ['null',string]
should work, even though it is not officially supported by OAS 3.0.
I think supporting nullable
would be useful, because we could use standard OAS linters that would fail when using type: ['null',string]
. OAS 3.1 solves all this, but unfortunately it has not reached RC status, yet.
from openapi_first.
This should be obsolete with OAS 3.1, since nullable will be removed from OpenAPI 3.1 and type arrays will be valid type: ['null', string ]
👍.
I think we can close this.
from openapi_first.
Reopening, because I want to support OpenAPI 3.0.x
from openapi_first.
@JF-Lalonde nullable has been removed from OAS since 3.1. Is updating your spec to 3.1 an option for you/your team?
from openapi_first.
FYI this will be solved in 1.0, because json_schemer supports it with it's OpenAPI 3.0 / 3.1 metaschema
from openapi_first.
Related Issues (20)
- Response header validation
- The purpose of hanami in this gem? HOT 10
- Manual request/response validation HOT 6
- v1.0.0.beta5 release not available via rubygems.org HOT 7
- Manual response validation breaking change in 1.0.0->1.1.0 upgrade HOT 2
- Spec has a binary field - openapi-first failing with exception trying to get the :tempfile HOT 13
- Don't read uploaded files to validate "binary" fields
- validation of string format uri wrongly fails with relative pathes HOT 5
- Parse error for kebab-case URL parameters HOT 4
- rails 6 - error when parsing non-array response body HOT 11
- Can't seem to get rid of a response validation error with format: byte, nullable true HOT 4
- Builtin middlewares trigger deprecation warnings. HOT 4
- Getting the full response with the ResponseInvalidError HOT 4
- Validate OpenAPI file
- Assertion methods HOT 1
- NoMethodError: undefined method `find_plugin' for module OpenapiFirst HOT 5
- Error: "can't modify frozen Hash" HOT 5
- Expose webhooks HOT 5
- Binary response gets converted to an array and throws a response validation error HOT 8
- Cannot validate responses that use `oneOf` unions with `discriminator`. HOT 6
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 openapi_first.