mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 03:22:42 +00:00
[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:
30
samples/client/petstore/ruby-httpx/spec/models/cow_spec.rb
Normal file
30
samples/client/petstore/ruby-httpx/spec/models/cow_spec.rb
Normal 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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user