openapi: normalize get policy from hash as list request

This commit is contained in:
Quaternions 2024-12-18 15:04:45 -08:00
parent 518327820d
commit 6a8805b91a
2 changed files with 131 additions and 41 deletions

View File

@ -110,6 +110,45 @@ paths:
schema: schema:
$ref: "#/components/schemas/Error" $ref: "#/components/schemas/Error"
/script-policy: /script-policy:
get:
summary: Get list of script policies
operationId: listScriptPolicy
tags:
- ScriptPolicy
parameters:
- $ref: "#/components/parameters/Page"
- $ref: "#/components/parameters/Limit"
- name: FromScriptHash
in: query
schema:
type: string
minLength: 16
maxLength: 16
- name: ToScriptID
in: query
schema:
type: integer
format: int64
- name: Policy
in: query
schema:
type: integer
format: int32
responses:
"200":
description: Successful response
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ScriptPolicy"
default:
description: General Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
post: post:
summary: Create a new script policy summary: Create a new script policy
operationId: createScriptPolicy operationId: createScriptPolicy
@ -134,34 +173,51 @@ paths:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: "#/components/schemas/Error"
/script-policy/hash/{FromScriptHash}: /scripts:
get: get:
summary: Get the policy for the given hash of script source code summary: Get list of scripts
operationId: getScriptPolicyFromHash operationId: listScripts
tags: tags:
- ScriptPolicy - Script
parameters: parameters:
- name: FromScriptHash - $ref: "#/components/parameters/Page"
in: path - $ref: "#/components/parameters/Limit"
required: true - name: Hash
schema: in: query
type: string schema:
minLength: 16 type: string
maxLength: 16 minLength: 16
maxLength: 16
- name: Name
in: query
schema:
type: string
maxLength: 128
- name: Source
in: query
schema:
type: string
maxLength: 1048576
- name: SubmissionID
in: query
schema:
type: integer
format: int64
responses: responses:
"200": "200":
description: Successful response description: Successful response
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/ScriptPolicy" type: array
items:
$ref: "#/components/schemas/Script"
default: default:
description: General Error description: General Error
content: content:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: "#/components/schemas/Error"
/scripts:
post: post:
summary: Create a new script summary: Create a new script
operationId: createScript operationId: createScript
@ -225,6 +281,23 @@ components:
schema: schema:
type: integer type: integer
format: int64 format: int64
Page:
name: Page
in: query
required: true
schema:
type: integer
format: int32
minimum: 1
Limit:
name: Limit
in: query
required: true
schema:
type: integer
format: int32
minimum: 1
maximum: 100
schemas: schemas:
Id: Id:
required: required:

View File

@ -311,34 +311,7 @@ paths:
application/json: application/json:
schema: schema:
$ref: "#/components/schemas/Error" $ref: "#/components/schemas/Error"
/script-policy/hash/{FromScriptHash}: /script-policy/{ScriptPolicyID}:
get:
summary: Get the policy for the given hash of script source code
operationId: getScriptPolicyFromHash
tags:
- ScriptPolicy
parameters:
- name: FromScriptHash
in: path
required: true
schema:
type: string
minLength: 16
maxLength: 16
responses:
"200":
description: Successful response
content:
application/json:
schema:
$ref: "#/components/schemas/ScriptPolicy"
default:
description: General Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/script-policy/id/{ScriptPolicyID}:
get: get:
summary: Get the specified script policy by ID summary: Get the specified script policy by ID
operationId: getScriptPolicy operationId: getScriptPolicy
@ -398,6 +371,50 @@ paths:
schema: schema:
$ref: "#/components/schemas/Error" $ref: "#/components/schemas/Error"
/scripts: /scripts:
get:
summary: Get list of scripts
operationId: listScripts
tags:
- Script
parameters:
- $ref: "#/components/parameters/Page"
- $ref: "#/components/parameters/Limit"
- name: Hash
in: query
schema:
type: string
minLength: 16
maxLength: 16
- name: Name
in: query
schema:
type: string
maxLength: 128
- name: Source
in: query
schema:
type: string
maxLength: 1048576
- name: SubmissionID
in: query
schema:
type: integer
format: int64
responses:
"200":
description: Successful response
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Script"
default:
description: General Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
post: post:
summary: Create a new script summary: Create a new script
operationId: createScript operationId: createScript