Module: NoSE::Serialize

Defined in:
lib/nose/serialize.rb

Overview

Serialization of workloads and statement execution plans

Defined Under Namespace

Classes: EntityBuilder, EntityFieldRepresenter, EntityRepresenter, FieldBuilder, FieldRepresenter, FilterStepRepresenter, FullIndexRepresenter, GraphRepresenter, IndexBuilder, IndexLookupStepRepresenter, IndexRepresenter, LimitStepRepresenter, ModelBuilder, ModelRepresenter, PlanStepRepresenter, QueryPlanBuilder, QueryPlanRepresenter, SearchResultRepresenter, SortStepRepresenter, StatementRepresenter, UpdatePlanBuilder, UpdatePlanRepresenter, UpdatePlanStepRepresenter, WorkloadBuilder, WorkloadRepresenter

Class Method Summary collapse

Class Method Details

.validate_json(json) ⇒ Object

Validate a string of JSON based on the schema



26
27
28
29
30
31
32
33
# File 'lib/nose/serialize.rb', line 26

def validate_json(json)
  schema_file = File.join File.dirname(__FILE__), '..', '..',
                          'data', 'nose', 'nose-schema.json'
  schema = JSON.parse File.read(schema_file)

  data = JSON.parse json
  JSON::Validator.validate(schema, data)
end