[docs] Use correct form for status submit (#915)

This commit is contained in:
tobi 2022-10-17 12:54:36 +02:00 committed by GitHub
parent f7416d6e94
commit ccd5b34c2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 94 additions and 163 deletions

View file

@ -147,77 +147,6 @@ definitions:
title: Source represents display or publishing preferences of user's own account.
type: object
x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model
StatusCreateRequest:
properties:
format:
description: |-
Format to use when parsing this status.
in: formData
type: string
x-go-name: Format
in_reply_to_id:
description: |-
ID of the status being replied to, if status is a reply.
in: formData
type: string
x-go-name: InReplyToID
language:
description: |-
ISO 639 language code for this status.
in: formData
type: string
x-go-name: Language
media_ids:
description: |-
Array of Attachment ids to be attached as media.
If provided, status becomes optional, and poll cannot be used.
If the status is being submitted as a form, the key is 'media_ids[]',
but if it's json or xml, the key is 'media_ids'.
in: formData
items:
type: string
type: array
x-go-name: MediaIDs
scheduled_at:
description: |-
ISO 8601 Datetime at which to schedule a status.
Providing this parameter will cause ScheduledStatus to be returned instead of Status.
Must be at least 5 minutes in the future.
in: formData
type: string
x-go-name: ScheduledAt
sensitive:
description: |-
Status and attached media should be marked as sensitive.
in: formData
type: boolean
x-go-name: Sensitive
spoiler_text:
description: |-
Text to be shown as a warning or subject before the actual content.
Statuses are generally collapsed behind this field.
in: formData
type: string
x-go-name: SpoilerText
status:
description: |-
Text content of the status.
If media_ids is provided, this becomes optional.
Attaching a poll is optional while status is provided.
in: formData
type: string
x-go-name: Status
visibility:
description: |-
Visibility of the posted status.
in: formData
type: string
x-go-name: Visibility
title: StatusCreateRequest models status creation parameters.
type: object
x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model
account:
description: The modelled account can be either a remote account, or one on this instance.
properties:
@ -474,96 +403,6 @@ definitions:
type: object
x-go-name: AdminEmoji
x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model
advancedStatusCreateForm:
description: |-
AdvancedStatusCreateForm wraps the mastodon-compatible status create form along with the GTS advanced
visibility settings.
properties:
boostable:
description: This status can be boosted/reblogged.
type: boolean
x-go-name: Boostable
federated:
description: This status will be federated beyond the local timeline(s).
type: boolean
x-go-name: Federated
format:
description: |-
Format to use when parsing this status.
in: formData
type: string
x-go-name: Format
in_reply_to_id:
description: |-
ID of the status being replied to, if status is a reply.
in: formData
type: string
x-go-name: InReplyToID
language:
description: |-
ISO 639 language code for this status.
in: formData
type: string
x-go-name: Language
likeable:
description: This status can be liked/faved.
type: boolean
x-go-name: Likeable
media_ids:
description: |-
Array of Attachment ids to be attached as media.
If provided, status becomes optional, and poll cannot be used.
If the status is being submitted as a form, the key is 'media_ids[]',
but if it's json or xml, the key is 'media_ids'.
in: formData
items:
type: string
type: array
x-go-name: MediaIDs
replyable:
description: This status can be replied to.
type: boolean
x-go-name: Replyable
scheduled_at:
description: |-
ISO 8601 Datetime at which to schedule a status.
Providing this parameter will cause ScheduledStatus to be returned instead of Status.
Must be at least 5 minutes in the future.
in: formData
type: string
x-go-name: ScheduledAt
sensitive:
description: |-
Status and attached media should be marked as sensitive.
in: formData
type: boolean
x-go-name: Sensitive
spoiler_text:
description: |-
Text to be shown as a warning or subject before the actual content.
Statuses are generally collapsed behind this field.
in: formData
type: string
x-go-name: SpoilerText
status:
description: |-
Text content of the status.
If media_ids is provided, this becomes optional.
Attaching a poll is optional while status is provided.
in: formData
type: string
x-go-name: Status
visibility:
description: |-
Visibility of the posted status.
in: formData
type: string
x-go-name: Visibility
type: object
x-go-name: AdvancedStatusCreateForm
x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model
advancedVisibilityFlagsForm:
description: |-
AdvancedVisibilityFlagsForm allows a few more advanced flags to be set on new statuses, in addition
@ -1779,6 +1618,78 @@ definitions:
type: object
x-go-name: Context
x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model
statusCreateRequest:
properties:
format:
description: |-
Format to use when parsing this status.
in: formData
type: string
x-go-name: Format
in_reply_to_id:
description: |-
ID of the status being replied to, if status is a reply.
in: formData
type: string
x-go-name: InReplyToID
language:
description: |-
ISO 639 language code for this status.
in: formData
type: string
x-go-name: Language
media_ids:
description: |-
Array of Attachment ids to be attached as media.
If provided, status becomes optional, and poll cannot be used.
If the status is being submitted as a form, the key is 'media_ids[]',
but if it's json or xml, the key is 'media_ids'.
in: formData
items:
type: string
type: array
x-go-name: MediaIDs
scheduled_at:
description: |-
ISO 8601 Datetime at which to schedule a status.
Providing this parameter will cause ScheduledStatus to be returned instead of Status.
Must be at least 5 minutes in the future.
in: formData
type: string
x-go-name: ScheduledAt
sensitive:
description: |-
Status and attached media should be marked as sensitive.
in: formData
type: boolean
x-go-name: Sensitive
spoiler_text:
description: |-
Text to be shown as a warning or subject before the actual content.
Statuses are generally collapsed behind this field.
in: formData
type: string
x-go-name: SpoilerText
status:
description: |-
Text content of the status.
If media_ids is provided, this becomes optional.
Attaching a poll is optional while status is provided.
in: formData
type: string
x-go-name: Status
visibility:
description: |-
Visibility of the posted status.
in: formData
type: string
x-go-name: Visibility
title: StatusCreateRequest models status creation parameters.
type: object
x-go-name: StatusCreateRequest
x-go-package: github.com/superseriousbusiness/gotosocial/internal/api/model
statusReblogged:
properties:
account:
@ -3917,6 +3828,26 @@ paths:
name: format
type: string
x-go-name: Format
- description: This status will be federated beyond the local timeline(s).
in: query
name: federated
type: boolean
x-go-name: Federated
- description: This status can be boosted/reblogged.
in: query
name: boostable
type: boolean
x-go-name: Boostable
- description: This status can be replied to.
in: query
name: replyable
type: boolean
x-go-name: Replyable
- description: This status can be liked/faved.
in: query
name: likeable
type: boolean
x-go-name: Likeable
produces:
- application/json
responses:

View file

@ -139,7 +139,7 @@ type StatusReblogged struct {
// StatusCreateRequest models status creation parameters.
//
// swagger:parameters statusCreate
// swagger:model statusCreateRequest
type StatusCreateRequest struct {
// Text content of the status.
// If media_ids is provided, this becomes optional.
@ -205,7 +205,7 @@ const (
// AdvancedStatusCreateForm wraps the mastodon-compatible status create form along with the GTS advanced
// visibility settings.
//
// swagger:model advancedStatusCreateForm
// swagger:parameters statusCreate
type AdvancedStatusCreateForm struct {
StatusCreateRequest
AdvancedVisibilityFlagsForm