-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[WEB-4045] feat: restructuring of the external APIs for better maintainability #7477
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
Merged
Merged
Changes from all commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
d91c665
Basic setup for drf-spectacular
dheeru0198 48f0cf4
Updated to only handle /api/v1 endpoints
dheeru0198 5d01843
feat: add asset and user endpoints with URL routing
pablohashescobar 7e174d1
Group endpoints by tags
dheeru0198 c317a1c
Detailed schema definitions and examples for asset endpoints
dheeru0198 b44a6d0
Removed unnecessary extension
dheeru0198 3890ccf
Specify avatar_url field separately
dheeru0198 0139ee8
chore: add project docs
pablohashescobar 1999deb
Merge branch 'openapi-specification' of github.com:makeplane/plane in…
pablohashescobar 527c610
chore: correct all errors
pablohashescobar e096faf
chore: added open spec in work items
NarayanBavisetti 23d0da9
Merge branch 'openapi-specification' of github.com:makeplane/plane in…
NarayanBavisetti e9c5ba0
feat: enhance cycle API endpoints with detailed OpenAPI specifications
pablohashescobar b5eafb6
Merge branch 'openapi-specification' of github.com:makeplane/plane in…
pablohashescobar 713f4ab
chore: added open spec in labels
NarayanBavisetti ec7d15e
chore: work item properties
NarayanBavisetti 9eac76e
feat: enhance API endpoints with OpenAPI specifications and HTTP meth…
pablohashescobar ba8db40
chore: run formatter
pablohashescobar c1e836f
Merge branch 'openapi-specification' of github.com:makeplane/plane in…
pablohashescobar f555d7a
Removed unnecessary settings for authentication
dheeru0198 e54b528
Refactors OpenAPI documentation structure
dheeru0198 e47509a
Merge branch 'preview' of github.com:makeplane/plane into openapi-spe…
pablohashescobar 0287930
Merge branch 'openapi-specification' of github.com:makeplane/plane in…
pablohashescobar 05d4c51
Refactor OpenAPI endpoint specifications
pablohashescobar 7df62ae
Enhance API documentation with detailed endpoint descriptions
dheeru0198 e4c27ae
Enhance API serializers and views with new request structures
dheeru0198 3ca5ba9
Refactor OpenAPI documentation and endpoint specifications
dheeru0198 2008996
chore: correct formatting
pablohashescobar d9ef52d
chore: correct formatting for all api folder files
pablohashescobar 6373201
refactor: clean up serializer imports and test setup
pablohashescobar 91d1b4c
feat: add project creation and update serializers with validation
pablohashescobar 84a3d51
feat: update serializers to include additional read-only fields
pablohashescobar 473de6b
refactor: rename intake issue serializers and enhance structure
pablohashescobar 4882c4c
refactor: rename issue serializer for intake and enhance API document…
dheeru0198 8a4aa99
chore: modules and cycles serializers
pablohashescobar 861a981
feat: add new serializers for label and issue link management
pablohashescobar 109bc9a
Don't consider read only fields as required
dheeru0198 2217b0e
Add setting to separate request and response definitions
dheeru0198 1f2739c
Merge branch 'preview' into openapi-specification
dheeru0198 3f341db
Fixed avatar_url warning on openapi spec generation
dheeru0198 71ee6dc
Made spectacular disabled by default
dheeru0198 c4f1059
Moved spectacular settings into separate file and added detailed desc…
dheeru0198 044de6e
Specify methods for asset urls
dheeru0198 9237984
Better server names
dheeru0198 b80df24
Enhance API documentation with summaries for various endpoints
pablohashescobar 7138409
Add contact information to OpenAPI settings
pablohashescobar d71b74b
Reordered tags and improved description relavancy
dheeru0198 1baa442
Enhance OpenAPI documentation for cycle and issue endpoints
dheeru0198 29e45ab
Enhance serializer documentation across multiple files
dheeru0198 2878f0a
Refactor API endpoints for cycles, intake, modules, projects, and states
pablohashescobar 470003d
Refactor issue and label API endpoints for clarity and functionality
pablohashescobar b203f69
Refactor asset API endpoint methods and introduce new status enums
pablohashescobar fd9765a
enforce naming convention
dheeru0198 7be89f7
Added LICENSE to openapi spec
dheeru0198 cfc632c
Merge branch 'preview' of github.com:makeplane/plane into openapi-spe…
pablohashescobar b2745eb
Merge branch 'openapi-specification' of github.com:makeplane/plane in…
pablohashescobar 06ec33b
Enhance OpenAPI documentation for various API endpoints
pablohashescobar bf25c69
Enhance OpenAPI documentation for various API endpoints
pablohashescobar 9749c87
Update OpenAPI examples and enhance project queryset logic
pablohashescobar 9474c66
Enhance OpenAPI documentation and add response examples
dheeru0198 2547549
Merge branch 'preview' of github.com:makeplane/plane into openapi-spe…
pablohashescobar f1cc5c5
Merge branch 'openapi-specification' of github.com:makeplane/plane in…
pablohashescobar 74ea37b
refactor: update terminology from 'issues' to 'work items' across mul…
pablohashescobar e60c153
use common timezones from pytz for choices
dheeru0198 0a20c8e
Merge branch 'preview' into openapi-specification-copy
dheeru0198 60daec3
Moved the openapi utils to the new folder structure
dheeru0198 4e4416b
Added exception logging in GenericAssetEndpoint to improve error hand…
dheeru0198 b15dda3
Fixed code rabbit suggestions
dheeru0198 c360850
Refactored IssueDetailAPIEndpoint to streamline issue retrieval and r…
dheeru0198 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,55 @@ | ||
| from .user import UserLiteSerializer | ||
| from .workspace import WorkspaceLiteSerializer | ||
| from .project import ProjectSerializer, ProjectLiteSerializer | ||
| from .project import ( | ||
| ProjectSerializer, | ||
| ProjectLiteSerializer, | ||
| ProjectCreateSerializer, | ||
| ProjectUpdateSerializer, | ||
| ) | ||
| from .issue import ( | ||
| IssueSerializer, | ||
| LabelCreateUpdateSerializer, | ||
| LabelSerializer, | ||
| IssueLinkSerializer, | ||
| IssueCommentSerializer, | ||
| IssueAttachmentSerializer, | ||
| IssueActivitySerializer, | ||
| IssueExpandSerializer, | ||
| IssueLiteSerializer, | ||
| IssueAttachmentUploadSerializer, | ||
| IssueSearchSerializer, | ||
| IssueCommentCreateSerializer, | ||
| IssueLinkCreateSerializer, | ||
| IssueLinkUpdateSerializer, | ||
| ) | ||
| from .state import StateLiteSerializer, StateSerializer | ||
| from .cycle import CycleSerializer, CycleIssueSerializer, CycleLiteSerializer | ||
| from .module import ModuleSerializer, ModuleIssueSerializer, ModuleLiteSerializer | ||
| from .intake import IntakeIssueSerializer | ||
| from .cycle import ( | ||
| CycleSerializer, | ||
| CycleIssueSerializer, | ||
| CycleLiteSerializer, | ||
| CycleIssueRequestSerializer, | ||
| TransferCycleIssueRequestSerializer, | ||
| CycleCreateSerializer, | ||
| CycleUpdateSerializer, | ||
| ) | ||
| from .module import ( | ||
| ModuleSerializer, | ||
| ModuleIssueSerializer, | ||
| ModuleLiteSerializer, | ||
| ModuleIssueRequestSerializer, | ||
| ModuleCreateSerializer, | ||
| ModuleUpdateSerializer, | ||
| ) | ||
| from .intake import ( | ||
| IntakeIssueSerializer, | ||
| IntakeIssueCreateSerializer, | ||
| IntakeIssueUpdateSerializer, | ||
| ) | ||
| from .estimate import EstimatePointSerializer | ||
| from .asset import ( | ||
| UserAssetUploadSerializer, | ||
| AssetUpdateSerializer, | ||
| GenericAssetUploadSerializer, | ||
| GenericAssetUpdateSerializer, | ||
| FileAssetSerializer, | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| # Third party imports | ||
| from rest_framework import serializers | ||
|
|
||
| # Module imports | ||
| from .base import BaseSerializer | ||
| from plane.db.models import FileAsset | ||
|
|
||
|
|
||
| class UserAssetUploadSerializer(serializers.Serializer): | ||
| """ | ||
| Serializer for user asset upload requests. | ||
| This serializer validates the metadata required to generate a presigned URL | ||
| for uploading user profile assets (avatar or cover image) directly to S3 storage. | ||
| Supports JPEG, PNG, WebP, JPG, and GIF image formats with size validation. | ||
| """ | ||
|
|
||
| name = serializers.CharField(help_text="Original filename of the asset") | ||
| type = serializers.ChoiceField( | ||
| choices=[ | ||
| ("image/jpeg", "JPEG"), | ||
| ("image/png", "PNG"), | ||
| ("image/webp", "WebP"), | ||
| ("image/jpg", "JPG"), | ||
| ("image/gif", "GIF"), | ||
| ], | ||
| default="image/jpeg", | ||
| help_text="MIME type of the file", | ||
| style={"placeholder": "image/jpeg"}, | ||
| ) | ||
| size = serializers.IntegerField(help_text="File size in bytes") | ||
| entity_type = serializers.ChoiceField( | ||
| choices=[ | ||
| (FileAsset.EntityTypeContext.USER_AVATAR, "User Avatar"), | ||
| (FileAsset.EntityTypeContext.USER_COVER, "User Cover"), | ||
| ], | ||
| help_text="Type of user asset", | ||
| ) | ||
|
|
||
|
|
||
| class AssetUpdateSerializer(serializers.Serializer): | ||
| """ | ||
| Serializer for asset status updates after successful upload completion. | ||
| Handles post-upload asset metadata updates including attribute modifications | ||
| and upload confirmation for S3-based file storage workflows. | ||
| """ | ||
|
|
||
| attributes = serializers.JSONField( | ||
| required=False, help_text="Additional attributes to update for the asset" | ||
| ) | ||
|
|
||
|
|
||
| class GenericAssetUploadSerializer(serializers.Serializer): | ||
| """ | ||
| Serializer for generic asset upload requests with project association. | ||
| Validates metadata for generating presigned URLs for workspace assets including | ||
| project association, external system tracking, and file validation for | ||
| document management and content storage workflows. | ||
| """ | ||
|
|
||
| name = serializers.CharField(help_text="Original filename of the asset") | ||
| type = serializers.CharField(required=False, help_text="MIME type of the file") | ||
sriramveeraghanta marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| size = serializers.IntegerField(help_text="File size in bytes") | ||
| project_id = serializers.UUIDField( | ||
| required=False, | ||
| help_text="UUID of the project to associate with the asset", | ||
| style={"placeholder": "123e4567-e89b-12d3-a456-426614174000"}, | ||
| ) | ||
| external_id = serializers.CharField( | ||
| required=False, | ||
| help_text="External identifier for the asset (for integration tracking)", | ||
| ) | ||
| external_source = serializers.CharField( | ||
| required=False, help_text="External source system (for integration tracking)" | ||
| ) | ||
|
|
||
|
|
||
| class GenericAssetUpdateSerializer(serializers.Serializer): | ||
| """ | ||
| Serializer for generic asset upload confirmation and status management. | ||
| Handles post-upload status updates for workspace assets including | ||
| upload completion marking and metadata finalization. | ||
| """ | ||
|
|
||
| is_uploaded = serializers.BooleanField( | ||
| default=True, help_text="Whether the asset has been successfully uploaded" | ||
| ) | ||
|
|
||
|
|
||
| class FileAssetSerializer(BaseSerializer): | ||
| """ | ||
| Comprehensive file asset serializer with complete metadata and URL generation. | ||
| Provides full file asset information including storage metadata, access URLs, | ||
| relationship data, and upload status for complete asset management workflows. | ||
| """ | ||
|
|
||
| asset_url = serializers.CharField(read_only=True) | ||
|
|
||
| class Meta: | ||
| model = FileAsset | ||
| fields = "__all__" | ||
| read_only_fields = [ | ||
| "id", | ||
| "created_by", | ||
| "updated_by", | ||
| "created_at", | ||
| "updated_at", | ||
| "workspace", | ||
| "project", | ||
| "issue", | ||
| "comment", | ||
| "page", | ||
| "draft_issue", | ||
| "user", | ||
| "is_deleted", | ||
| "deleted_at", | ||
| "storage_metadata", | ||
| "asset_url", | ||
| ] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.