Module: Verquest::Properties

Defined in:
lib/verquest/properties.rb,
lib/verquest/properties/base.rb,
lib/verquest/properties/array.rb,
lib/verquest/properties/field.rb,
lib/verquest/properties/object.rb,
lib/verquest/properties/reference.rb,
lib/verquest/properties/collection.rb

Overview

Property types for defining versioned API request schemas

The Properties module contains classes representing different types of properties that can be used when defining API request schemas. Each property type knows how to generate its own schema representation and handles mapping between external and internal parameter structures.

Examples:

Using properties in a schema definition

class UserRequest < Verquest::Base
  version "2023-01" do
    # Field - Basic scalar properties
    field :email, type: :string, required: true

    # Object - Nested structure with properties
    object :address do
      field :street, type: :string
      field :city, type: :string, required: true
    end

    # Collection - Array of objects
    collection :orders do
      field :id, type: :string, required: true
      field :amount, type: :number
    end

    # Array - Simple array of scalar values
    array :tags, type: :string

    # Reference - Reference to another schema
    reference :payment, from: PaymentRequest
  end
end

See Also:

Defined Under Namespace

Classes: Array, Base, Collection, Field, Object, Reference