Sha256: 8ef9036003dae7fd3a00b197b1c44fa9e24543dd0c710e66e00b4c241ef31f40

Contents?: true

Size: 690 Bytes

Versions: 2

Compression:

Stored size: 690 Bytes

Contents

require 'spec_helper'
module Finitio
  module JsonSchema
    describe "A recursive type" do

      let(:system){
        ::Finitio.system <<-FIO
          Tree = {
            children : [Tree]
          }
        FIO
      }

      let(:type) {
        system['Tree']
      }

      it 'works as expected' do
        expect(type.to_json_schema).to eql({
          type: "object",
          properties: {
            children: {
              type: "array",
              items: {
                type: "object"
              }
            }
          },
          required: [
            :children
          ],
          additionalProperties: false
        })
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
finitio-0.12.0 spec/json_schema/test_recursive_type.rb
finitio-0.11.4 spec/json_schema/test_recursive_type.rb