Class: Lina::Schema

Inherits:
Object
  • Object
show all
Defined in:
lib/lina/schema.rb

Class Method Summary collapse

Class Method Details

.argumentObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/lina/schema.rb', line 3

def self.argument
  {
    type: "object",
    required: ['name', 'params', 'return'],
    properties: {
      name: {
        type: "string",
        description: "api name"
      },
      description: {
        type: 'string',
      },
      params: {
        type: "object",
      },
      return: {
        type: "object",
      }
    }
  }
end

.params_validator(params) ⇒ Object



25
26
27
28
29
30
# File 'lib/lina/schema.rb', line 25

def self.params_validator(params)
  {
    type: 'object',
    properties: params
  }
end