Conch API

Logo

Datacenter build and management service

View the Project on GitHub joyent/conch-api

Conch::DB::Result::JSONSchema

SOURCE

https://github.com/joyent/conch-api/blob/master/lib/Conch/DB/Result/JSONSchema.pm

BASE CLASS: Conch::DB::Result

TABLE: json_schema

ACCESSORS

id

data_type: 'uuid'
default_value: gen_random_uuid()
is_nullable: 0
size: 16

type

data_type: 'text'
is_nullable: 0

name

data_type: 'text'
is_nullable: 0

version

data_type: 'integer'
is_nullable: 0

body

data_type: 'jsonb'
is_nullable: 0

created

data_type: 'timestamp with time zone'
default_value: current_timestamp
is_nullable: 0
original: {default_value => \"now()"}

created_user_id

data_type: 'uuid'
is_foreign_key: 1
is_nullable: 0
size: 16

deactivated

data_type: 'timestamp with time zone'
is_nullable: 1

PRIMARY KEY

UNIQUE CONSTRAINTS

json_schema_type_name_version_key

RELATIONS

created_user

Type: belongs_to

Related object: Conch::DB::Result::UserAccount

hardware_product_json_schemas

Type: has_many

Related object: Conch::DB::Result::HardwareProductJSONSchema

validation_results

Type: has_many

Related object: Conch::DB::Result::ValidationResult

METHODS

TO_JSON

Include information about the JSON Schema’s creation user, or user who added the JSON Schema to hardware (when fetched from a hardware_product context).

canonical_path

The canonical path to this resource.

schema_document

Returns the actual JSON Schema document itself, suitable for returning to a client or adding to a JSON::Schema::Draft201909 object.

Takes an optional coderef, which takes the result object and returns the value to be used for the $id property (otherwise, “canonical_path” will be used).

LICENSING

Copyright Joyent, Inc.

This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://www.mozilla.org/en-US/MPL/2.0/.