Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Use correct form for status submit #915

Merged
merged 1 commit into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
253 changes: 92 additions & 161 deletions docs/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions internal/api/model/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down