Skip to content

Update AttachmentCreateRequest schema properties#59

Open
ramiro51 wants to merge 1 commit intofulcrumapp:v2from
ramiro51:patch-2
Open

Update AttachmentCreateRequest schema properties#59
ramiro51 wants to merge 1 commit intofulcrumapp:v2from
ramiro51:patch-2

Conversation

@ramiro51
Copy link
Copy Markdown

"type": "object",
"required": [
"owners"
],
"additionalProperties": false,
"properties": {
"owners": {
"type": "array",
"description": "Array of owner objects for the attachment",
"items": {
"type": "object",
"required": [
"type",
"id"
],
"properties": {
"type": {
"type": "string",
"description": "Type of the owner (e.g., 'record', 'form')"
},
"id": {
"type": "string",
"description": "Identifier of the owner"
}
}
}
},
"name": {
"type": "string",
"description": "Name of the attachment"
},
"file_size": {
"type": "integer",
"description": "Size of the file in bytes"
},
"metadata": {
"type": "object",
"description": "Optional metadata for the attachment",
"additionalProperties": true
}
}
},

 "type": "object",
        "required": [
          "owners"
        ],
        "additionalProperties": false,
        "properties": {
          "owners": {
            "type": "array",
            "description": "Array of owner objects for the attachment",
            "items": {
              "type": "object",
              "required": [
                "type",
                "id"
              ],
              "properties": {
                "type": {
                  "type": "string",
                  "description": "Type of the owner (e.g., 'record', 'form')"
                },
                "id": {
                  "type": "string",
                  "description": "Identifier of the owner"
                }
              }
            }
          },
          "name": {
            "type": "string",
            "description": "Name of the attachment"
          },
          "file_size": {
            "type": "integer",
            "description": "Size of the file in bytes"
          },
          "metadata": {
            "type": "object",
            "description": "Optional metadata for the attachment",
            "additionalProperties": true
          }
        }
      },
Copilot AI review requested due to automatic review settings April 27, 2026 15:31
@ramiro51 ramiro51 requested review from a team as code owners April 27, 2026 15:31
@ramiro51
Copy link
Copy Markdown
Author

@chrisworkmode Hi! Here is the revised version of this previous pull request after following Copilot recommendations 28c61ea

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the OpenAPI schema for AttachmentCreateRequest to reflect attachment creation fields at the top level (removing the nested attachment object) and to define owners, name, file_size, and metadata directly on the request.

Changes:

  • Flattened AttachmentCreateRequest by removing the attachment wrapper.
  • Promoted owners, name, file_size, and metadata to top-level schema properties.
  • Updated required fields to require owners at the top level.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread reference/rest-api.json
}
"owners": {
"type": "array",
"description": "Array of owner objects for the attachment",
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The owners array is documented as requiring at least one owner for attachment creation, but the schema doesn’t enforce this. Consider adding minItems: 1 so client-side validation and generated SDKs match the API requirement.

Suggested change
"description": "Array of owner objects for the attachment",
"description": "Array of owner objects for the attachment",
"minItems": 1,

Copilot uses AI. Check for mistakes.
Comment thread reference/rest-api.json
"properties": {
"type": {
"type": "string",
"description": "Type of the owner (e.g., 'record', 'form')"
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The create-attachment endpoint description indicates owner type must be either record or form, but the schema allows any string. Consider constraining this field with an enum (or a pattern) so the schema matches the documented API behavior.

Suggested change
"description": "Type of the owner (e.g., 'record', 'form')"
"enum": [
"record",
"form"
],
"description": "Type of the owner (must be either 'record' or 'form')"

Copilot uses AI. Check for mistakes.
@chrisworkmode
Copy link
Copy Markdown
Contributor

@chrisworkmode Hi! Here is the revised version of this previous pull request after following Copilot recommendations 28c61ea

Thanks @ramiro51. For future reference, you can update your existing PR instead of creating a whole new one. Also, if your other PR is not longer necessary, please close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants