-
Notifications
You must be signed in to change notification settings - Fork 480
feat(swagger): Add Swagger annotations to Batch 2 - Content Management Core #32657
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
Open
spbolton
wants to merge
10
commits into
main
Choose a base branch
from
issue-32529-batch-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ff46483
Batch 2 resources
spbolton 8440e45
Merged origin/main, resolved conflicts, ran test scripts, reviewed in…
jdcmsd deaabc0
snipping application/javascript from a Produces annotation
jdcmsd dfc3653
Used git rebase --rebase-merges origin/main.
jdcmsd c3cbc99
Added example req bodies for _search and v1/content/search
jdcmsd 0dc7787
Fix annotation issues: 1 missing @consumes, 1 duplicate id
jdcmsd a0b7bfb
Forgot to rebuild before last push
jdcmsd ecb310d
tag resource 200 response
jdcmsd e0da523
remove duplicated code from merge
spbolton f77c5ba
extra doc & schema for search, wrapper for _search,
jdcmsd 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
349 changes: 324 additions & 25 deletions
349
dotCMS/src/main/java/com/dotcms/rest/ContentResource.java
Large diffs are not rendered by default.
Oops, something went wrong.
273 changes: 180 additions & 93 deletions
273
dotCMS/src/main/java/com/dotcms/rest/api/v1/categories/CategoriesResource.java
Large diffs are not rendered by default.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
dotCMS/src/main/java/com/dotcms/rest/api/v1/categories/CategoryImportData.java
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,48 @@ | ||
| package com.dotcms.rest.api.v1.categories; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import org.glassfish.jersey.media.multipart.FormDataContentDisposition; | ||
| import org.glassfish.jersey.media.multipart.FormDataParam; | ||
| import java.io.InputStream; | ||
|
|
||
| /** | ||
| * Runtime binding bean for multipart form parts. | ||
| */ | ||
| @Schema(name = "CategoryImportFormSchema", description = "Category import form data with CSV file and processing parameters") | ||
| public class CategoryImportData { | ||
|
|
||
| private InputStream fileInputStream; | ||
| private FormDataContentDisposition fileDetail; | ||
| private String filter; | ||
| private String exportType; | ||
| private String contextInode; | ||
|
|
||
| @FormDataParam("file") | ||
| @JsonProperty("file") | ||
| @Schema(name = "file", description = "CSV file containing categories to import", type = "string", format = "binary") | ||
| public void setFileInputStream(final InputStream inputStream) { this.fileInputStream = inputStream; } | ||
|
|
||
| @FormDataParam("file") | ||
| @Schema(hidden = true) | ||
| public void setFileDetail(final FormDataContentDisposition detail) { this.fileDetail = detail; } | ||
|
|
||
| @FormDataParam("filter") | ||
| @Schema(description = "Filter pattern for categories") | ||
| public void setFilter(final String filter) { this.filter = filter; } | ||
|
|
||
| @FormDataParam("exportType") | ||
| @Schema(description = "Import behavior", allowableValues = {"replace", "merge"}) | ||
| public void setExportType(final String exportType) { this.exportType = exportType; } | ||
|
|
||
| @FormDataParam("contextInode") | ||
| @Schema(description = "Context category inode to import into") | ||
| public void setContextInode(final String contextInode) { this.contextInode = contextInode; } | ||
|
|
||
| public InputStream getFileInputStream() { return fileInputStream; } | ||
| public FormDataContentDisposition getFileDetail() { return fileDetail; } | ||
| public String getFilter() { return filter; } | ||
| public String getExportType() { return exportType; } | ||
| public String getContextInode() { return contextInode; } | ||
| } | ||
|
|
||
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you been able to load this into the API Playground?
Once, I attempted to document an InputStream setter and it broke the playground
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting! So, on the Playground end, it seems to be good:
And it generates a 200 when I import a category export CSV. But no new categories appear; system logs indicate a null pointer exception.