Sha256: 300e2c264cdbd7987199168e785967a6a94ecff1cda6a005c77cd9e05c33cfe4

Contents?: true

Size: 784 Bytes

Versions: 17

Compression:

Stored size: 784 Bytes

Contents

require 'spec_helper'

RSpec.describe Examples::Ids, type: :integration do
  include JSON::SchemaBuilder::RSpecHelper
  let(:schema_method){ :example }

  it_behaves_like 'a builder' do
    let(:expected_json) do
      {
        type: :object,
        required: [:user_id],
        properties: {
          user_id: {
            oneOf: [
              { type: 'integer', minimum: 1 },
              { type: 'string', pattern: '^[1-9]\d*$' }
            ]
          },
          optional_id: {
            oneOf: [
              { type: 'integer', minimum: 1 },
              { type: 'string', pattern: '^[1-9]\d*$' },
              { type: 'null' }
            ]
          },
          an_id: id_schema,
          a_nullable_id: nullable_id_schema
        }
      }
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
json-schema_builder-0.8.2 spec/integration/ids_spec.rb
json-schema_builder-0.8.1 spec/integration/ids_spec.rb
json-schema_builder-0.8.0 spec/integration/ids_spec.rb
json-schema_builder-0.7.1 spec/integration/ids_spec.rb
json-schema_builder-0.7.0 spec/integration/ids_spec.rb
json-schema_builder-0.6.1 spec/integration/ids_spec.rb
json-schema_builder-0.6.0 spec/integration/ids_spec.rb
json-schema_builder-0.5.0 spec/integration/ids_spec.rb
json-schema_builder-0.4.0 spec/integration/ids_spec.rb
json-schema_builder-0.3.1 spec/integration/ids_spec.rb
json-schema_builder-0.3.0 spec/integration/ids_spec.rb
json-schema_builder-0.2.1 spec/integration/ids_spec.rb
json-schema_builder-0.2.0 spec/integration/ids_spec.rb
json-schema_builder-0.1.0 spec/integration/ids_spec.rb
json-schema_builder-0.0.9 spec/integration/ids_spec.rb
json-schema_builder-0.0.8 spec/integration/ids_spec.rb
json-schema_builder-0.0.7 spec/integration/ids_spec.rb