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.84 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.83 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.82 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.81 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.80 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.79 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.78 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.77 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.76 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.75 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.74 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.73 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.72 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.71 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.70 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.69 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.68 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.67 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.66 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb
ree_lib-1.0.65 lib/ree_lib/packages/ree_swagger/spec/functions/build_schema_spec.rb