Skip to content

Commit

Permalink
fix(openapi): openapi spec changes
Browse files Browse the repository at this point in the history
  • Loading branch information
julianlam committed Jul 17, 2020
1 parent 8089a74 commit c452a6f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 60 deletions.
107 changes: 48 additions & 59 deletions public/openapi/read.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3046,6 +3046,9 @@ paths:
type: boolean
downvoted:
type: boolean
flagId:
type: number
description: The flag identifier, if this particular post has been flagged before
"/api/topic/tid/{id}":
get:
tags:
Expand Down Expand Up @@ -3692,6 +3695,9 @@ paths:
type: boolean
display_post_menu:
type: boolean
flagId:
type: number
description: The flag identifier, if this particular post has been flagged before
category:
$ref: components/schemas/CategoryObject.yaml#/CategoryObject
tagWhitelist:
Expand Down Expand Up @@ -4745,6 +4751,9 @@ paths:
properties:
state:
type: string
heat:
type: number
description: The number of reports that make up this flag
flagId:
type: number
type:
Expand All @@ -4753,34 +4762,8 @@ paths:
oneOf:
- type: string
- type: number
description:
type: string
uid:
type: number
description: A user identifier
datetime:
type: number
reporter:
type: object
properties:
username:
type: string
description: A friendly name for a given user account
picture:
nullable: true
type: string
icon:bgColor:
type: string
description: A six-character hexadecimal colour code assigned to the user. This
value is used in conjunction with
`icon:text` for the user's auto-generated
icon
example: "#f44336"
icon:text:
type: string
description: A single-letter representation of a username. This is used in the
auto-generated icon given to users without
an avatar
labelClass:
type: string
target_readable:
Expand Down Expand Up @@ -4843,11 +4826,6 @@ paths:
type: string
targetId:
type: number
description:
type: string
uid:
type: number
description: A user identifier
datetime:
type: number
datetimeISO:
Expand Down Expand Up @@ -4963,34 +4941,45 @@ paths:
`icon:text` for the user's auto-generated
icon
example: "#f44336"
reporter:
type: object
properties:
username:
type: string
description: A friendly name for a given user account
userslug:
type: string
description: An URL-safe variant of the username (i.e. lower-cased, spaces
removed, etc.)
picture:
nullable: true
reputation:
type: number
uid:
type: number
description: A user identifier
icon:text:
type: string
description: A single-letter representation of a username. This is used in the
auto-generated icon given to users without an
avatar
icon:bgColor:
type: string
description: A six-character hexadecimal colour code assigned to the user. This
value is used in conjunction with `icon:text` for
the user's auto-generated icon
example: "#f44336"
reports:
type: array
items:
type: object
properties:
value:
type: string
timestamp:
type: number
timestampISO:
type: string
reporter:
type: object
properties:
username:
type: string
description: A friendly name for a given user account
userslug:
type: string
description: An URL-safe variant of the username (i.e. lower-cased, spaces
removed, etc.)
picture:
nullable: true
reputation:
type: number
uid:
type: number
description: A user identifier
icon:text:
type: string
description: A single-letter representation of a username. This is used in the
auto-generated icon given to users without an
avatar
icon:bgColor:
type: string
description: A six-character hexadecimal colour code assigned to the user. This
value is used in conjunction with `icon:text` for
the user's auto-generated icon
example: "#f44336"
type_path:
type: string
assignees:
Expand Down
2 changes: 1 addition & 1 deletion src/flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Flags.get = async function (flagId) {
state: 'open',
assignee: null,
...base,
datetimeISO: utils.toISOString(base.datetime),
target_readable: base.type.charAt(0).toUpperCase() + base.type.slice(1) + ' ' + base.targetId,
target: await Flags.getTarget(base.type, base.targetId, 0),
history: history,
Expand Down Expand Up @@ -167,7 +168,6 @@ Flags.list = async function (filters, uid) {
flagObj.labelClass = Flags._constants.state_class[flagObj.state];

return Object.assign(flagObj, {
description: validator.escape(String(flagObj.description)),
target_readable: flagObj.type.charAt(0).toUpperCase() + flagObj.type.slice(1) + ' ' + flagObj.targetId,
datetimeISO: utils.toISOString(flagObj.datetime),
});
Expand Down

0 comments on commit c452a6f

Please sign in to comment.