Sha256: 8c10d2d2af236c41eb14f9b61cec217580caf93191d8d6a53b9adfe7517e2934

Contents?: true

Size: 580 Bytes

Versions: 7

Compression:

Stored size: 580 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb')

describe Attributor::Object do
  context 'JSON Schema representation' do
    subject { UntypedObject.as_json_schema }
    it 'is an Any Type' do
      # "A schema without a type matches any data type – numbers, strings, objects, and so on."
      # c.f. https://swagger.io/docs/specification/data-models/data-types/#any
      expect(subject).not_to have_key(:type)
      # but we still preserve Ruby type name, if anyone is curious
      expect(subject[:"x-type_name"]).to eq("UntypedObject")
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
attributor-8.0 spec/types/object_spec.rb
attributor-7.1 spec/types/object_spec.rb
attributor-7.0 spec/types/object_spec.rb
attributor-6.5 spec/types/object_spec.rb
attributor-6.4 spec/types/object_spec.rb
attributor-6.3 spec/types/object_spec.rb
attributor-6.2 spec/types/object_spec.rb