- RESOURCE_URIS_SCHEMA =
{
type: 'object',
properties: {
object: { type: 'string' },
source: { type: 'string' }
},
required: %w[object source]
}.freeze
- LIST_GEMS_SCHEMA =
array_schema(:gems)
- LIST_CLASSES_SCHEMA =
{
type: 'object',
properties: {
gem_name: { type: 'string' },
classes: { type: 'array', items: { type: 'string' } }
},
required: %w[gem_name classes]
}.freeze
- DOC_OBJECT_SCHEMA =
{
type: 'object',
properties: {
path: { type: 'string' },
gem_name: { type: %w[string null] },
resource_uris: RESOURCE_URIS_SCHEMA,
document: {
type: 'object',
properties: {
type: { type: 'string' },
name: { type: 'string' },
namespace: { type: %w[string null] },
visibility: { type: %w[string null] },
docstring: { type: 'string' },
parameters: { type: %w[array null] },
return: { type: %w[object null] },
source: { type: %w[string null] },
tags: { type: 'array' }
},
required: %w[type name docstring tags]
}
},
required: %w[resource_uris document]
}.freeze
- CHILDREN_SCHEMA =
path_array_schema(:children)
- METHODS_SCHEMA =
path_array_schema(:methods)
- SOURCE_LOCATION_SCHEMA =
{
type: 'object',
properties: {
path: { type: 'string' },
gem_name: { type: %w[string null] },
resource_uris: RESOURCE_URIS_SCHEMA,
source_location: {
type: 'object',
properties: {
file: { type: %w[string null] },
line: { type: %w[integer null] }
},
required: %w[file line]
}
},
required: %w[path resource_uris source_location]
}.freeze
- HIERARCHY_SCHEMA =
{
type: 'object',
properties: {
path: { type: 'string' },
gem_name: { type: %w[string null] },
resource_uris: RESOURCE_URIS_SCHEMA,
hierarchy: {
type: 'object',
properties: {
superclass: { type: %w[string null] },
included_modules: { type: 'array', items: { type: 'string' } },
mixins: { type: 'array', items: { type: 'string' } }
},
required: %w[superclass included_modules mixins]
}
},
required: %w[path resource_uris hierarchy]
}.freeze
- SEARCH_SCHEMA =
{
type: 'object',
properties: {
query: { type: 'string' },
gem_name: { type: %w[string null] },
limit: { type: 'integer' },
offset: { type: 'integer' },
results: {
type: 'array',
items: {
type: 'object',
properties: {
path: { type: 'string' },
score: { type: 'integer' }
},
required: %w[path score]
}
}
},
required: %w[query limit offset results]
}.freeze
- CODE_SNIPPET_SCHEMA =
{
type: 'object',
properties: {
path: { type: 'string' },
gem_name: { type: %w[string null] },
resource_uris: RESOURCE_URIS_SCHEMA,
snippet: { type: 'string' }
},
required: %w[path resource_uris snippet]
}.freeze
- ANCESTORS_SCHEMA =
path_array_schema(:ancestors)
- RELATED_OBJECTS_SCHEMA =
{
type: 'object',
properties: {
path: { type: 'string' },
gem_name: { type: %w[string null] },
resource_uris: RESOURCE_URIS_SCHEMA,
related_objects: {
type: 'object',
properties: {
included_modules: { type: 'array', items: { type: 'string' } },
mixins: { type: 'array', items: { type: 'string' } },
subclasses: { type: 'array', items: { type: 'string' } }
},
required: %w[included_modules mixins subclasses]
}
},
required: %w[path resource_uris related_objects]
}.freeze
- BUILD_GEM_DOCS_SCHEMA =
{
type: 'object',
properties: {
gem_name: { type: 'string' },
indexed: { type: 'boolean' }
},
required: %w[gem_name indexed]
}.freeze