[Ruby][client] Handle enums (and other scalars) in oneOf and anyOf schemas (#17515)

* Handle enums in oneOf and anyOf schemas

* Update specs
This commit is contained in:
Armand Mégrot
2024-01-05 08:01:08 +01:00
committed by GitHub
parent 5c571b0e1f
commit 07a9257ee9
25 changed files with 578 additions and 10 deletions

View File

@@ -0,0 +1,30 @@
=begin
#OpenAPI Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 7.3.0-SNAPSHOT
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for Petstore::Cow
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe Petstore::Cow do
let(:instance) { Petstore::Cow.new }
describe 'test an instance of Cow' do
it 'should create an instance of Cow' do
# uncomment below to test the instance creation
#expect(instance).to be_instance_of(Petstore::Cow)
end
end
end

View File

@@ -0,0 +1,32 @@
=begin
#OpenAPI Petstore
#This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
OpenAPI Generator version: 7.3.0-SNAPSHOT
=end
require 'spec_helper'
require 'json'
require 'date'
# Unit tests for Petstore::MamalWithEnum
# Automatically generated by openapi-generator (https://openapi-generator.tech)
# Please update as you see appropriate
describe Petstore::MamalWithEnum do
describe '.openapi_one_of' do
it 'lists the items referenced in the oneOf array' do
expect(described_class.openapi_one_of).to_not be_empty
end
end
describe '.build' do
it 'returns the correct model' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
end
end
end