Skip to content

Commit

Permalink
chore(swagger): improved description
Browse files Browse the repository at this point in the history
  • Loading branch information
Yury4GL committed Oct 29, 2024
1 parent 3053c68 commit 049a7f4
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
20 changes: 10 additions & 10 deletions api/public/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ components:
properties:
code:
type: string
description: 'Code of program'
example: '* Code HERE;'
description: 'The code to be executed'
example: '* Your Code HERE;'
runTime:
$ref: '#/components/schemas/RunTimeType'
description: 'runtime for program'
description: 'The runtime for the code - eg SAS, JS, PY or R'
example: js
required:
- code
Expand All @@ -113,7 +113,7 @@ components:
properties:
sessionId:
type: string
description: "Session ID (SAS WORK folder) used to execute code.\nThis session ID should be used to poll job status."
description: "The SessionId is the name of the temporary folder used to store the outputs.\nFor SAS, this would be the SASWORK folder. Can be used to poll job status.\nThis session ID should be used to poll job status."
example: '{ sessionId: ''20241028074744-54132-1730101664824'' }'
required:
- sessionId
Expand All @@ -123,11 +123,11 @@ components:
properties:
code:
type: string
description: 'Code of program'
example: '* Code HERE;'
description: 'The code to be executed'
example: '* Your Code HERE;'
runTime:
$ref: '#/components/schemas/RunTimeType'
description: 'runtime for program'
description: 'The runtime for the code - eg SAS, JS, PY or R'
example: sas
expiresAfterMins:
type: number
Expand Down Expand Up @@ -846,7 +846,7 @@ paths:
schema:
$ref: '#/components/schemas/TriggerCodeResponse'
description: 'Trigger Code on the Specified Runtime'
summary: 'Trigger Code and Return Session Id not awaiting for the job completion'
summary: 'Triggers code and returns SessionId immediately - does not wait for job completion'
tags:
- Code
security:
Expand Down Expand Up @@ -1852,15 +1852,15 @@ paths:
bearerAuth: []
parameters:
-
description: 'Location of code in SASjs Drive'
description: 'Location of Stored Program in SASjs Drive.'
in: query
name: _program
required: true
schema:
type: string
example: /Projects/myApp/some/program
-
description: 'Optional query param for setting debug mode, which will return the session log.'
description: 'Optional query param for setting debug mode (returns the session log in the response body).'
in: query
name: _debug
required: false
Expand Down
17 changes: 9 additions & 8 deletions api/src/controllers/code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ import {

interface ExecuteCodePayload {
/**
* Code of program
* @example "* Code HERE;"
* The code to be executed
* @example "* Your Code HERE;"
*/
code: string
/**
* runtime for program
* The runtime for the code - eg SAS, JS, PY or R
* @example "js"
*/
runTime: RunTimeType
}

interface TriggerCodePayload {
/**
* Code of program
* @example "* Code HERE;"
* The code to be executed
* @example "* Your Code HERE;"
*/
code: string
/**
* runtime for program
* The runtime for the code - eg SAS, JS, PY or R
* @example "sas"
*/
runTime: RunTimeType
Expand All @@ -42,7 +42,8 @@ interface TriggerCodePayload {

interface TriggerCodeResponse {
/**
* Session ID (SAS WORK folder) used to execute code.
* The SessionId is the name of the temporary folder used to store the outputs.
* For SAS, this would be the SASWORK folder. Can be used to poll job status.
* This session ID should be used to poll job status.
* @example "{ sessionId: '20241028074744-54132-1730101664824' }"
*/
Expand Down Expand Up @@ -74,7 +75,7 @@ export class CodeController {

/**
* Trigger Code on the Specified Runtime
* @summary Trigger Code and Return Session Id not awaiting for the job completion
* @summary Triggers code and returns SessionId immediately - does not wait for job completion
*/
@Post('/trigger')
public async triggerCode(
Expand Down
4 changes: 2 additions & 2 deletions api/src/controllers/stp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ export class STPController {
* https://server.sasjs.io/storedprograms
*
* @summary Execute a Stored Program, returns _webout and (optionally) log.
* @param _program Location of code in SASjs Drive
* @param _debug Optional query param for setting debug mode, which will return the session log.
* @param _program Location of Stored Program in SASjs Drive.
* @param _debug Optional query param for setting debug mode (returns the session log in the response body).
* @example _program "/Projects/myApp/some/program"
* @example _debug 131
*/
Expand Down

0 comments on commit 049a7f4

Please sign in to comment.