Sha256: fd7d175160125c8de2988bf1336007f5f18aabd50b32a9d94aff6a9f7783e60b

Contents?: true

Size: 1.39 KB

Versions: 112

Compression:

Stored size: 1.39 KB

Contents

RSpec.describe :build_schema do
  link :build_schema, from: :ree_swagger

  it {
    schema = build_schema(
      title: 'Sample API',
      description: 'Sample API description',
      version: '0.0.1',
      api_url: 'https://some-api.com/api/v1',
      endpoints: [ReeSwagger::EndpointDto.new(
        method:          :get,
        authenticate:    true,
        path:            '/version',
        respond_to:      :json,
        caster:          nil,
        serializer:      nil,
        response_status: 200,
        description:     nil,
        summary:         nil,
        errors:          []
      )]
    )

    expect(schema).to eq(
      {
        openapi: '3.0.0',
        info: {
          title: 'Sample API',
          description: 'Sample API description',
          version: '0.0.1'
        },
        components: {
          securitySchemes: {
            ApiKeyAuth: {
              in: "header",
              name: "Authorization",
              type: "apiKey",
            }
          }
        },
        servers: [
          { url: 'https://some-api.com/api/v1' }
        ],
        paths: {
          '/version' => {
            get: {
              security: [
                {ApiKeyAuth: []}
              ],
              responses: {
                200 => {
                  description: ''
                }
              }
            }
          }
        }
      }
    )
  }
end

Version data entries

112 entries across 112 versions & 1 rubygems

Version Path
ree_lib-1.0.124 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.123 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.122 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.121 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.120 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.119 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.118 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.117 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.116 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.115 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.114 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.113 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.112 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.111 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.110 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.109 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.108 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.107 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.106 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.105 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb