diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index f1ebdbc..bd1014a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,10 @@ Changelog ========= +1.4.3 - (Unreleased) +--------------------------- +- Enh #164: Convert swagger docs to OpenAPI 3.0 + 1.4.2 (November 11, 2025) ------------------------- - Fix #161: Fixed `weary-emoji` in installer example content diff --git a/docs/swagger/build.sh b/docs/swagger/build.sh old mode 100644 new mode 100755 index f89b5ab..3a9d1cf --- a/docs/swagger/build.sh +++ b/docs/swagger/build.sh @@ -2,10 +2,5 @@ for filename in *.yaml; do echo "--------- $filename ---------------------" - - npx redoc-cli bundle --cdn -o $(basename "$filename" .yaml).html $filename - - # We need to use 'htm' as extension, since spectacle removes all other html files from target dir - #/usr/bin/spectacle "$filename" -t "../html/" -f "$(basename "$filename" .yaml).htm" - + npx @redocly/cli build-docs $filename -o $(basename "$filename" .yaml).html done \ No newline at end of file diff --git a/docs/swagger/poll.html b/docs/swagger/poll.html index 5bc933c..becccdc 100644 --- a/docs/swagger/poll.html +++ b/docs/swagger/poll.html @@ -12,406 +12,386 @@ margin: 0; } - - -

HumHub - Polls API (1.0.0)

Download OpenAPI specification:Download

E-mail: info@humhub.com License: AGPLv2

Welcome to the HumHub polls module API reference.

-

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Polls

Find all polls

query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Find all polls by container

path Parameters
id
required
integer

ID of content container

-
query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Delete polls by container

path Parameters
id
required
integer

The id of content container

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Records successfully deleted!"
}

Poll

Create new poll

path Parameters
id
required
integer

The id of content container

-
Request Body schema: application/json

Poll information

-
required
object
newAnswers
required
Array of strings

New answers

-
object (Content)

Responses

Request samples

Content type
application/json
{
  • "Poll": {
    },
  • "newAnswers": [
    ],
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "id": 4,
  • "contentcontainer_id": 2,
  • "question": "Poll question from API?",
  • "description": "Poll description from API",
  • "allow_multiple": 1,
  • "created_at": "2021-07-20 09:43:12",
  • "created_by": {},
  • "updated_at": "2021-07-20 09:43:12",
  • "updated_by": {},
  • "is_random": 1,
  • "closed": 1,
  • "anonymous": 0,
  • "show_result_after_close": 0,
  • "answers": [
    ],
  • "content": {}
}

Get a poll by id

path Parameters
id
required
integer

The id of the poll

-

Responses

Response samples

Content type
application/json
{
  • "id": 4,
  • "contentcontainer_id": 2,
  • "question": "Poll question from API?",
  • "description": "Poll description from API",
  • "allow_multiple": 1,
  • "created_at": "2021-07-20 09:43:12",
  • "created_by": {},
  • "updated_at": "2021-07-20 09:43:12",
  • "updated_by": {},
  • "is_random": 1,
  • "closed": 1,
  • "anonymous": 0,
  • "show_result_after_close": 0,
  • "answers": [
    ],
  • "content": {}
}

Update a poll by id

path Parameters
id
required
integer

The id of the poll

-
Request Body schema: application/json

Poll information

-
required
object
answers
Array of strings

Updating answers

-
newAnswers
required
Array of strings

New answers

-
object (Content)

Responses

Request samples

Content type
application/json
{
  • "Poll": {
    },
  • "answers": [
    ],
  • "newAnswers": [
    ],
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "id": 4,
  • "contentcontainer_id": 2,
  • "question": "Poll question from API?",
  • "description": "Poll description from API",
  • "allow_multiple": 1,
  • "created_at": "2021-07-20 09:43:12",
  • "created_by": {},
  • "updated_at": "2021-07-20 09:43:12",
  • "updated_by": {},
  • "is_random": 1,
  • "closed": 1,
  • "anonymous": 0,
  • "show_result_after_close": 0,
  • "answers": [
    ],
  • "content": {}
}

Delete a poll by id

path Parameters
id
required
integer

The id of the poll

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully deleted!"
}

Poll management

Close a poll by id

path Parameters
id
required
integer

The id of the poll

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Poll has been successfully closed."
}

Open a poll by id

path Parameters
id
required
integer

The id of the poll

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Poll has been successfully reopened."
}

Poll voting

Vote on a poll by id

path Parameters
id
required
integer

The id of the poll

-
Request Body schema: application/json
answers
Array of integers[ items ]

Selected answers

-

Responses

Request samples

Content type
application/json
{
  • "answers": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "You have voted."
}

Reset vote on a poll by id

path Parameters
id
required
integer

The id of the poll

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "You have reset your vote."
}

Get votes on a poll for current user

path Parameters
id
required
integer

The id of the poll

-

Responses

Response samples

Content type
application/json
[
  • [
    ]
]
- + diff --git a/docs/swagger/poll.yaml b/docs/swagger/poll.yaml index 903b595..e1876f8 100644 --- a/docs/swagger/poll.yaml +++ b/docs/swagger/poll.yaml @@ -1,796 +1,975 @@ -swagger: '2.0' +openapi: 3.0.0 info: description: | Welcome to the HumHub polls module API reference. - version: 1.0.0 title: HumHub - Polls API contact: email: info@humhub.com license: name: AGPLv2 - url: 'https://www.humhub.org/en/licences' -basePath: /api/v1 - + url: https://www.humhub.org/en/licences paths: - '/polls': + /polls: get: tags: - Polls summary: Find all polls - description: '' - produces: - - application/json - - application/xml + description: "" parameters: - - $ref: 'https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/parameters/pageParam' - - $ref: 'https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/parameters/limitParam' + - $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/parameters/pageParam + - $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/parameters/limitParam responses: - '200': + "200": description: Success - schema: - type: object - properties: - total: - $ref: 'https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/properties/totalProperty' - page: - $ref: 'https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/properties/pageProperty' - pages: - $ref: 'https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/properties/pagesProperty' - links: - $ref: 'https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/properties/linksProperty' - results: - type: array - items: - $ref: '#/definitions/Poll' - - '/polls/container/{id}': + content: + application/json: + schema: + type: object + properties: + total: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/totalProperty + page: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/pageProperty + pages: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/pagesProperty + links: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/linksProperty + results: + type: array + items: + $ref: "#/components/schemas/Poll" + application/xml: + schema: + type: object + properties: + total: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/totalProperty + page: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/pageProperty + pages: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/pagesProperty + links: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/linksProperty + results: + type: array + items: + $ref: "#/components/schemas/Poll" + "/polls/container/{id}": get: tags: - Polls summary: Find all polls by container - description: '' - produces: - - application/json - - application/xml + description: "" parameters: - name: id in: path description: ID of content container required: true - type: integer - - $ref: 'https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/parameters/pageParam' - - $ref: 'https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/parameters/limitParam' + schema: + type: integer + - $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/parameters/pageParam + - $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/parameters/limitParam responses: - 200: + "200": description: Success - schema: - type: object - properties: - total: - $ref: 'https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/properties/totalProperty' - page: - $ref: 'https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/properties/pageProperty' - pages: - $ref: 'https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/properties/pagesProperty' - links: - $ref: 'https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/properties/linksProperty' - results: - type: array - items: - $ref: '#/definitions/Poll' - 404: + content: + application/json: + schema: + type: object + properties: + total: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/totalProperty + page: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/pageProperty + pages: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/pagesProperty + links: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/linksProperty + results: + type: array + items: + $ref: "#/components/schemas/Poll" + application/xml: + schema: + type: object + properties: + total: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/totalProperty + page: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/pageProperty + pages: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/pagesProperty + links: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/components/schemas/linksProperty + results: + type: array + items: + $ref: "#/components/schemas/Poll" + "404": description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Content container not found! + application/xml: + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Content container not found! post: tags: - Poll summary: Create new poll - description: '' - produces: - - application/json + description: "" parameters: - in: path name: id description: The id of content container required: true - type: integer - - $ref: "#/definitions/PollNewParams" + schema: + type: integer + requestBody: + content: + application/json: + schema: + type: object + required: + - Poll + - newAnswers + properties: + Poll: + type: object + required: + - question + properties: + question: + type: string + example: New question from API? + description: + type: string + example: New description from API? + allow_multiple: + type: integer + format: int64 + example: 0 + is_random: + type: integer + format: int64 + example: 1 + anonymous: + type: integer + format: int64 + example: 0 + show_result_after_close: + type: integer + format: int64 + example: 0 + newAnswers: + type: array + description: New answers + items: + type: string + example: + - First answer + - Second answer + - Third answer + content: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/content.yaml#/components/schemas/Content + description: Poll information responses: - 200: + "200": description: Success - schema: - $ref: "#/definitions/Poll" - 403: + content: + application/json: + schema: + $ref: "#/components/schemas/Poll" + "403": description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to create a poll! - 404: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + example: You are not allowed to create a poll! + "404": description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - 422: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Content container not found! + "422": description: Validation failed - 500: + "500": description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while save a poll! - + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 500 + message: + type: string + example: Internal error while save a poll! delete: tags: - Polls summary: Delete polls by container - produces: - - application/json parameters: - name: id in: path description: The id of content container required: true - type: integer + schema: + type: integer responses: - 200: + "200": description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Records successfully deleted! - 404: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 200 + message: + type: string + example: Records successfully deleted! + "404": description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - - '/polls/poll/{id}': + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Content container not found! + "/polls/poll/{id}": get: tags: - Poll summary: Get a poll by id - description: '' - produces: - - application/json + description: "" parameters: - name: id in: path description: The id of the poll required: true - type: integer + schema: + type: integer responses: - 200: + "200": description: Success - schema: - $ref: "#/definitions/Poll" - 404: + content: + application/json: + schema: + $ref: "#/components/schemas/Poll" + "404": description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Poll not found - + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Poll not found put: tags: - Poll summary: Update a poll by id - description: '' - produces: - - application/json + description: "" parameters: - name: id in: path description: The id of the poll required: true - type: integer - - $ref: "#/definitions/PollEditParams" + schema: + type: integer + requestBody: + content: + application/json: + schema: + type: object + required: + - Poll + - newAnswers + properties: + Poll: + type: object + required: + - question + properties: + question: + type: string + example: New question from API? + description: + type: string + example: New description from API? + allow_multiple: + type: integer + format: int64 + example: 0 + is_random: + type: integer + format: int64 + example: 1 + anonymous: + type: integer + format: int64 + example: 0 + show_result_after_close: + type: integer + format: int64 + example: 0 + answers: + type: array + description: Updating answers + items: + type: string + example: + - "1": Updated first answer + - "2": Updated second answer + - "3": Updated third answer + newAnswers: + type: array + description: New answers + items: + type: string + example: + - Fourth answer + - Fifth answer + content: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/content.yaml#/components/schemas/Content + description: Poll information responses: - 200: + "200": description: Success - schema: - $ref: "#/definitions/Poll" - 403: + content: + application/json: + schema: + $ref: "#/components/schemas/Poll" + "403": description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to update this poll! - 404: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + example: You are not allowed to update this poll! + "404": description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Poll is not found! - 422: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Poll is not found! + "422": description: Validation failed - 500: + "500": description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while update poll! - + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 500 + message: + type: string + example: Internal error while update poll! delete: tags: - Poll summary: Delete a poll by id - produces: - - application/json parameters: - name: id in: path description: The id of the poll required: true - type: integer + schema: + type: integer responses: - 200: + "200": description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Successfully deleted! - 403: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 200 + message: + type: string + example: Successfully deleted! + "403": description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to delete this content! - 404: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + example: You are not allowed to delete this content! + "404": description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content record not found! - 500: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Content record not found! + "500": description: Bad request - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while delete content! - -#----------------------------------------------------------------------------------------------------------------------- -# Begin Poll Management -#----------------------------------------------------------------------------------------------------------------------- - - '/polls/poll/{id}/close': + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 500 + message: + type: string + example: Internal error while delete content! + "/polls/poll/{id}/close": patch: tags: - Poll management summary: Close a poll by id - description: '' - produces: - - application/json + description: "" parameters: - name: id in: path description: The id of the poll required: true - type: integer + schema: + type: integer responses: - 200: + "200": description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Poll has been successfully closed. - 403: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 200 + message: + type: string + example: Poll has been successfully closed. + "403": description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to close this poll! - 404: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + example: You are not allowed to close this poll! + "404": description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Poll not found - 500: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Poll not found + "500": description: Bad request - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while close this poll! - - '/polls/poll/{id}/open': + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 500 + message: + type: string + example: Internal error while close this poll! + "/polls/poll/{id}/open": patch: tags: - Poll management summary: Open a poll by id - description: '' - produces: - - application/json + description: "" parameters: - name: id in: path description: The id of the poll required: true - type: integer + schema: + type: integer responses: - 200: + "200": description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Poll has been successfully reopened. - 403: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 200 + message: + type: string + example: Poll has been successfully reopened. + "403": description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to open this poll! - 404: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + example: You are not allowed to open this poll! + "404": description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Poll is not found! - 500: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Poll is not found! + "500": description: Bad request - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while open this poll! - -#----------------------------------------------------------------------------------------------------------------------- -# Begin Poll Voting -#----------------------------------------------------------------------------------------------------------------------- - - '/polls/vote/{id}': + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 500 + message: + type: string + example: Internal error while open this poll! + "/polls/vote/{id}": put: tags: - Poll voting summary: Vote on a poll by id - description: '' - produces: - - application/json + description: "" parameters: - name: id in: path description: The id of the poll required: true - type: integer - - name: body - in: body - required: true schema: - type: object - required: - - status - properties: - answers: - type: array - description: Selected answers - items: - type: integer - example: - - 1 - - 4 + type: integer + requestBody: + content: + application/json: + schema: + type: object + required: + - status + properties: + answers: + type: array + description: Selected answers + items: + type: integer + example: + - 1 + - 4 + required: true responses: - 200: + "200": description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: You have voted. - 403: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 200 + message: + type: string + example: You have voted. + "403": description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: Voting for multiple answers is disabled! - 404: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + example: Voting for multiple answers is disabled! + "404": description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Poll is not found! - + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Poll is not found! delete: tags: - Poll voting summary: Reset vote on a poll by id - description: '' - produces: - - application/json + description: "" parameters: - name: id in: path description: The id of the poll required: true - type: integer + schema: + type: integer responses: - 200: + "200": description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: You have reset your vote. - 403: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 200 + message: + type: string + example: You have reset your vote. + "403": description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: Voting for multiple answers is disabled! - 404: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + example: Voting for multiple answers is disabled! + "404": description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Poll is not found! - + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Poll is not found! get: tags: - Poll voting summary: Get votes on a poll for current user - description: '' - produces: - - application/json + description: "" parameters: - name: id in: path description: The id of the poll required: true - type: integer + schema: + type: integer responses: - 200: + "200": description: Success - schema: - type: array - items: - type: integer - example: [11,13,24] - 404: + content: + application/json: + schema: + type: array + items: + type: integer + example: + - 11 + - 13 + - 24 + "404": description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Poll is not found! - -securityDefinitions: - $ref: "https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/securityDefinitions" - -definitions: - Poll: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 4 - contentcontainer_id: - type: integer - format: int64 - readOnly: true - example: 2 - question: - type: string - example: Poll question from API? - description: - type: string - example: Poll description from API - allow_multiple: - type: integer - format: int64 - example: 1 - created_at: - type: string - example: 2021-07-20 09:43:12 - created_by: - $ref: "https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/user.yaml#/definitions/UserShort" - updated_at: - type: string - example: 2021-07-20 09:43:12 - updated_by: - $ref: "https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/user.yaml#/definitions/UserShort" - is_random: - type: integer - format: int64 - example: 1 - closed: - type: integer - format: int64 - example: 1 - anonymous: - type: integer - format: int64 - example: 0 - show_result_after_close: - type: integer - format: int64 - example: 0 - answers: - type: array - items: - $ref: "#/definitions/Answer" - content: - $ref: "https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/content.yaml#/definitions/Content" - - Answer: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 1 - poll_id: - type: integer - format: int64 - readOnly: true - example: 4 - answer: - type: string - example: First answer text - created_at: - type: string - example: 2021-07-20 10:43:12 - created_by: - $ref: "https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/user.yaml#/definitions/UserShort" - updated_at: - type: string - example: 2021-07-20 10:43:12 - updated_by: - $ref: "https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/user.yaml#/definitions/UserShort" - - PollNewParams: - in: body - name: body - required: true - description: Poll information - schema: + content: + application/json: + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Poll is not found! +servers: + - url: /api/v1 +components: + securitySchemes: + _ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/common.yaml#/securityDefinitions + schemas: + Poll: type: object - required: - - Poll - - newAnswers properties: - Poll: - type: object - required: - - question - properties: - question: - type: string - example: New question from API? - description: - type: string - example: New description from API? - allow_multiple: - type: integer - format: int64 - example: 0 - is_random: - type: integer - format: int64 - example: 1 - anonymous: - type: integer - format: int64 - example: 0 - show_result_after_close: - type: integer - format: int64 - example: 0 - newAnswers: + id: + type: integer + format: int64 + readOnly: true + example: 4 + contentcontainer_id: + type: integer + format: int64 + readOnly: true + example: 2 + question: + type: string + example: Poll question from API? + description: + type: string + example: Poll description from API + allow_multiple: + type: integer + format: int64 + example: 1 + created_at: + type: string + example: 2021-07-20 09:43:12 + created_by: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/user.yaml#/components/schemas/UserShort + updated_at: + type: string + example: 2021-07-20 09:43:12 + updated_by: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/user.yaml#/components/schemas/UserShort + is_random: + type: integer + format: int64 + example: 1 + closed: + type: integer + format: int64 + example: 1 + anonymous: + type: integer + format: int64 + example: 0 + show_result_after_close: + type: integer + format: int64 + example: 0 + answers: type: array - description: New answers items: - type: string - example: - - "First answer" - - "Second answer" - - "Third answer" + $ref: "#/components/schemas/Answer" content: - $ref: "https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/content.yaml#/definitions/Content" - - PollEditParams: - in: body - name: body - required: true - description: Poll information - schema: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/content.yaml#/components/schemas/Content + Answer: type: object - required: - - Poll - - newAnswers properties: - Poll: - type: object - required: - - question - properties: - question: + id: + type: integer + format: int64 + readOnly: true + example: 1 + poll_id: + type: integer + format: int64 + readOnly: true + example: 4 + answer: + type: string + example: First answer text + created_at: + type: string + example: 2021-07-20 10:43:12 + created_by: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/user.yaml#/components/schemas/UserShort + updated_at: + type: string + example: 2021-07-20 10:43:12 + updated_by: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/user.yaml#/components/schemas/UserShort + PollNewParams: + in: body + name: body + description: Poll information + schema: + type: object + required: + - Poll + - newAnswers + properties: + Poll: + type: object + required: + - question + properties: + question: + type: string + example: New question from API? + description: + type: string + example: New description from API? + allow_multiple: + type: integer + format: int64 + example: 0 + is_random: + type: integer + format: int64 + example: 1 + anonymous: + type: integer + format: int64 + example: 0 + show_result_after_close: + type: integer + format: int64 + example: 0 + newAnswers: + type: array + description: New answers + items: + type: string + example: + - First answer + - Second answer + - Third answer + content: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/content.yaml#/components/schemas/Content + x-s2o-delete: true + PollEditParams: + in: body + name: body + description: Poll information + schema: + type: object + required: + - Poll + - newAnswers + properties: + Poll: + type: object + required: + - question + properties: + question: + type: string + example: New question from API? + description: + type: string + example: New description from API? + allow_multiple: + type: integer + format: int64 + example: 0 + is_random: + type: integer + format: int64 + example: 1 + anonymous: + type: integer + format: int64 + example: 0 + show_result_after_close: + type: integer + format: int64 + example: 0 + answers: + type: array + description: Updating answers + items: type: string - example: New question from API? - description: + example: + - "1": Updated first answer + - "2": Updated second answer + - "3": Updated third answer + newAnswers: + type: array + description: New answers + items: type: string - example: New description from API? - allow_multiple: - type: integer - format: int64 - example: 0 - is_random: - type: integer - format: int64 - example: 1 - anonymous: - type: integer - format: int64 - example: 0 - show_result_after_close: - type: integer - format: int64 - example: 0 - answers: - type: array - description: Updating answers - items: - type: string - example: - - "1": "Updated first answer" - - "2": "Updated second answer" - - "3": "Updated third answer" - newAnswers: - type: array - description: New answers - items: - type: string - example: - - "Fourth answer" - - "Fifth answer" - content: - $ref: "https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/content.yaml#/definitions/Content" \ No newline at end of file + example: + - Fourth answer + - Fifth answer + content: + $ref: https://raw.githubusercontent.com/humhub/rest/master/docs/swagger/content.yaml#/components/schemas/Content + x-s2o-delete: true diff --git a/module.json b/module.json index c7f774e..67254fa 100644 --- a/module.json +++ b/module.json @@ -3,7 +3,7 @@ "name": "Polls", "description": "Easily create polls, streamline decision-making, and harness the power of voting.", "keywords": ["poll", "voting", "decision making"], - "version": "1.4.2", + "version": "1.4.3", "humhub": { "minVersion": "1.18" },