You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
components:
schemas:
BaseFolderFilter:
type: objectdescription: The backend supports compound filters, therefore you can include either `folder_group_id`, or `folder_name` or both fields.properties:
folder_group_id:
type: integerdescription: Group ID associated with the folder to filter.example: 1234minimum: 1folder_name:
type: stringdescription: Name of the folder where to add the file.example: sample_folderFileCreateData:
description: Payload for `NEW` or `CONTENT_CHANGE` actions.allOf:
- $ref: "#/components/schemas/BaseFolderFilter"
- type: objectrequired: [file_name, file_download_url]properties:
file_name:
type: stringdescription: Name of the file to add or modify.example: sample_pdf.pdffile_download_url:
type: stringformat: uridescription: Accessible URL to download the document.example: https://pdfobject.com/pdf/sample.pdfFileDeleteData:
description: Payload for `DELETE` action.allOf:
- $ref: "#/components/schemas/BaseFolderFilter"
- type: objectrequired: [file_name]properties:
file_name:
type: stringdescription: Name of the file to delete.example: sample_pdf.pdfFileRenameData:
description: Payload for `RENAME` action.required: [old_file_name, new_file_name]allOf:
- $ref: "#/components/schemas/BaseFolderFilter"
- type: objectrequired: [old_file_name, new_file_name]properties:
old_file_name:
type: stringdescription: Name of the existing file to be renamed.example: old_sample_pdf.pdfnew_file_name:
type: stringdescription: New name of the file.example: new_sample_pdf.pdfDocumentSyncRequestBody:
type: objectrequired: [action, data]properties:
action:
type: stringenum: [NEW, CONTENT_CHANGE, RENAME, DELETE]description: Action name to execute.data:
oneOf:
- $ref: "#/components/schemas/FileCreateData"
- $ref: "#/components/schemas/FileRenameData"
- $ref: "#/components/schemas/FileDeleteData"
OAPI Codegen generated the following code
// DocumentSyncRequestBody defines model for DocumentSyncRequestBody.typeDocumentSyncRequestBodystruct {
// Action Action name to execute.ActionDocumentSyncRequestBodyAction`json:"action"`DataDocumentSyncRequestBody_Data`json:"data"`
}
// DocumentSyncRequestBodyAction Action name to execute.typeDocumentSyncRequestBodyActionstring// DocumentSyncRequestBody_Data defines model for DocumentSyncRequestBody.Data.typeDocumentSyncRequestBody_Datastruct {
union json.RawMessage
}
// ... more structs for FileCreateData, FileRenameData and FileDeleteData
It is returning invalid JSON body response during BindJSON
body:=new(api.DocumentSyncRequestBody)
iferr:=c.BindJSON(body); err!=nil {
c.AbortWithStatusJSON(http.StatusBadRequest, transformErrorneousResponse(http.StatusBadRequest, "Failed to parse request body."))
log.Error("Failed to parse request body", slog.Any("err", err))
return
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
For the following openapi schema
OAPI Codegen generated the following code
It is returning invalid JSON body response during BindJSON
Beta Was this translation helpful? Give feedback.
All reactions