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

Update REST API.md #133

Merged
merged 2 commits into from
May 29, 2024
Merged

Update REST API.md #133

merged 2 commits into from
May 29, 2024

Conversation

makoni
Copy link
Collaborator

@makoni makoni commented May 29, 2024

Description

Checklist

Summary by CodeRabbit

  • Documentation

    • Added a new "Document info" section in the REST API documentation.
    • Updated URLs in Upload API.md and README.md to reflect new file upload sources.
  • Bug Fixes

    • Corrected URLs for file uploads and signatures in Swift code snippets to point to ucarecdn.com.
  • Tests

    • Updated test URLs in multiple test files to ensure consistency with the new file upload source.

Copy link
Contributor

coderabbitai bot commented May 29, 2024

Walkthrough

The recent changes primarily involve updating URLs in various files, shifting from source.unsplash.com to ucarecdn.com. This update impacts documentation, source code, and test files, reflecting a change in the data source for file uploads and related operations. Additionally, a new section for "Document info" has been added in the REST API documentation.

Changes

Files/Paths Change Summary
Documentation/REST API.md Added a new section for "Document info" in the REST API documentation.
Documentation/Upload API.md, README.md Updated URLs in code snippets to point to ucarecdn.com instead of source.unsplash.com.
Sources/Uploadcare/UploadAPI.swift Updated the URL string in a guard statement to ucarecdn.com.
Sources/Uploadcare/models/upload/UploadedFile.swift Updated URL string in the example code block to ucarecdn.com.
Tests/UploadcareTests/...IntegrationAsyncTests.swift Updated URLs in various test methods to ucarecdn.com for file operations.
Tests/UploadcareTests/...IntegrationTests.swift Updated URLs in multiple test methods to ucarecdn.com for various test scenarios.

Poem

In the realm of code, a shift so grand,
URLs now point to a different land.
From Unsplash to Ucare we gracefully leap,
Ensuring our uploads are strong and deep.
Tests and docs, all aligned with care,
A seamless transition, we're proud to share.
🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (3)
Documentation/REST API.md (3)

Line range hint 63-63: Consider adding a comma before 'or' in complex sentences.

- Keep in mind that since Uploadcare is not a singleton. You should store a strong reference (as an instance variable, for example) to your Uploadcare object or it will get deallocated.
+ Keep in mind that since Uploadcare is not a singleton, you should store a strong reference (as an instance variable, for example) to your Uploadcare object, or it will get deallocated.

Line range hint 472-472: Clarify the preposition used with "returned".

- A redirected URL will be caught and returned in the completion handler of that method.
+ A redirected URL will be caught and returned by the completion handler of that method.

Line range hint 65-65: Ensure consistent use of Markdown heading styles.

Please ensure that all headings are consistently formatted. It seems there are discrepancies in how some headings are closed. This might affect the rendering on different markdown viewers.

Also applies to: 132-132, 167-167, 240-240, 278-278, 316-316, 333-333, 352-352, 422-422, 439-439, 452-452, 469-469, 494-494, 511-511, 532-532, 554-554, 572-572, 591-591, 632-632, 661-661, 709-709

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 723b0f0 and b9c7509.
Files selected for processing (1)
  • Documentation/REST API.md (1 hunks)
Additional Context Used
LanguageTool (4)
Documentation/REST API.md (4)

Near line 21: Possible typo: you repeated a word
Context: ...document-info-api-reference) * Convert document * [Document conversion job status](#document-conver...
Rule ID: ENGLISH_WORD_REPEAT_RULE


Near line 23: Possible typo: you repeated a word
Context: ...on-job-status-api-reference) * Convert video * [Video conversion job status](#video-conversio...
Rule ID: ENGLISH_WORD_REPEAT_RULE


Near line 63: Use a comma before ‘or’ if it connects two independent clauses (unless they are closely connected and short).
Context: ..., for example) to your Uploadcare object or it will get deallocated. ## List of fi...
Rule ID: COMMA_COMPOUND_SENTENCE


Near line 472: The usual collocation for “returned” is “to”, not “in”.
Context: ...RL. A redirected URL will be caught and returned in the completion handler of that method. ...
Rule ID: RETURN_IN_THE

Markdownlint (60)
Documentation/REST API.md (60)

65: Expected: atx; Actual: atx_closed
Heading style


132: Expected: atx; Actual: atx_closed
Heading style


167: Expected: atx; Actual: atx_closed
Heading style


240: Expected: atx; Actual: atx_closed
Heading style


278: Expected: atx; Actual: atx_closed
Heading style


316: Expected: atx; Actual: atx_closed
Heading style


333: Expected: atx; Actual: atx_closed
Heading style


352: Expected: atx; Actual: atx_closed
Heading style


422: Expected: atx; Actual: atx_closed
Heading style


439: Expected: atx; Actual: atx_closed
Heading style


452: Expected: atx; Actual: atx_closed
Heading style


469: Expected: atx; Actual: atx_closed
Heading style


494: Expected: atx; Actual: atx_closed
Heading style


511: Expected: atx; Actual: atx_closed
Heading style


532: Expected: atx; Actual: atx_closed
Heading style


554: Expected: atx; Actual: atx_closed
Heading style


572: Expected: atx; Actual: atx_closed
Heading style


591: Expected: atx; Actual: atx_closed
Heading style


632: Expected: atx; Actual: atx_closed
Heading style


661: Expected: atx; Actual: atx_closed
Heading style


709: Expected: atx; Actual: atx_closed
Heading style


12: Expected: 0 or 2; Actual: 1
Trailing spaces


839: Expected: 0 or 2; Actual: 16
Trailing spaces


885: Expected: 0 or 2; Actual: 16
Trailing spaces


190: Column: 1
Hard tabs


412: Column: 36
Hard tabs


568: Column: 6
Hard tabs


640: Column: 1
Hard tabs


642: Column: 1
Hard tabs


861: Column: 1
Hard tabs


29: Expected: 1; Actual: 2
Multiple consecutive blank lines


739: Expected: 1; Actual: 2
Multiple consecutive blank lines


439: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


740: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


743: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


782: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


821: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


866: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


150: null
Fenced code blocks should be surrounded by blank lines


170: null
Fenced code blocks should be surrounded by blank lines


186: null
Fenced code blocks should be surrounded by blank lines


205: null
Fenced code blocks should be surrounded by blank lines


225: null
Fenced code blocks should be surrounded by blank lines


391: null
Fenced code blocks should be surrounded by blank lines


407: null
Fenced code blocks should be surrounded by blank lines


440: null
Fenced code blocks should be surrounded by blank lines


745: null
Fenced code blocks should be surrounded by blank lines


761: null
Fenced code blocks should be surrounded by blank lines


777: null
Fenced code blocks should be surrounded by blank lines


784: null
Fenced code blocks should be surrounded by blank lines


800: null
Fenced code blocks should be surrounded by blank lines


816: null
Fenced code blocks should be surrounded by blank lines


823: null
Fenced code blocks should be surrounded by blank lines


841: null
Fenced code blocks should be surrounded by blank lines


857: null
Fenced code blocks should be surrounded by blank lines


868: null
Fenced code blocks should be surrounded by blank lines


887: null
Fenced code blocks should be surrounded by blank lines


903: null
Fenced code blocks should be surrounded by blank lines


474: null
Bare URL used


474: null
Bare URL used

Additional comments not posted (1)
Documentation/REST API.md (1)

20-20: Addition of "Document info" section to the API documentation.

This new section helps in expanding the documentation to cover more features of the service. Ensure that the internal links are correctly set up to lead to the appropriate sections.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between b9c7509 and d2e6721.
Files selected for processing (8)
  • Documentation/Upload API.md (3 hunks)
  • README.md (1 hunks)
  • Sources/Uploadcare/UploadAPI.swift (1 hunks)
  • Sources/Uploadcare/models/upload/UploadedFile.swift (1 hunks)
  • Tests/UploadcareTests/RESTAPIIntegrationAsyncTests.swift (9 hunks)
  • Tests/UploadcareTests/RESTAPIIntegrationTests.swift (9 hunks)
  • Tests/UploadcareTests/UploadAPIIntegrationAsyncTests.swift (4 hunks)
  • Tests/UploadcareTests/UploadAPIIntegrationTests.swift (8 hunks)
Files skipped from review due to trivial changes (3)
  • Sources/Uploadcare/models/upload/UploadedFile.swift
  • Tests/UploadcareTests/RESTAPIIntegrationAsyncTests.swift
  • Tests/UploadcareTests/UploadAPIIntegrationAsyncTests.swift
Additional Context Used
LanguageTool (10)
Documentation/Upload API.md (6)

Near line 11: This phrase is duplicated. You should probably use “files group” only once.
Context: ...fo](#file-info-api-reference) * Create files group * Files group info ...
Rule ID: PHRASE_REPETITION


Near line 52: Use a comma before ‘or’ if it connects two independent clauses (unless they are closely connected and short).
Context: ..., for example) to your Uploadcare object or it will get deallocated. ## File uploa...
Rule ID: COMMA_COMPOUND_SENTENCE


Near line 158: Use a comma before ‘or’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...are dealing with files larger than 100MB or you explicitly want to accelerate uploa...
Rule ID: COMMA_COMPOUND_SENTENCE


Near line 163: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...nsaction You can use this upload method and it'll run all 3 steps for you: ```swif...
Rule ID: COMMA_COMPOUND_SENTENCE


Near line 225: Possible missing comma found.
Context: ...f you don't want to wait for the upload completion you can start uploading and check it's ...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA


Near line 225: “It’s” is the contracted form of “it is”. Did you mean to use the possessive determiner “its”?
Context: ...etion you can start uploading and check it's status manually: ```swift // Async uplo...
Rule ID: AI_HYDRA_LEO_SCY_IT_S

README.md (4)

Near line 39: Possible missing comma found.
Context: ..., branch("develop")) ] ``` To add from Xcode select File -> Swift Packages -> Add Pa...
Rule ID: AI_HYDRA_LEO_MISSING_COMMA


Near line 68: You might be missing the article “the” here.
Context: ...ploadcare/uploadcare-swift' To use current dev version: pod 'Uploadcare', git...
Rule ID: AI_EN_LECTOR_MISSING_DETERMINER_THE


Near line 111: Use a comma before ‘or’ if it connects two independent clauses (unless they are closely connected and short).
Context: ..., for example) to your Uploadcare object or it will get deallocated. ## Using Uplo...
Rule ID: COMMA_COMPOUND_SENTENCE


Near line 161: You might be missing the article “a” here.
Context: ... Swift concurrency. Example of getting list of files: ```swift // Make a list of f...
Rule ID: AI_EN_LECTOR_MISSING_DETERMINER_A

Markdownlint (27)
Documentation/Upload API.md (16)

54: Expected: atx; Actual: atx_closed
Heading style


117: Expected: atx; Actual: atx_closed
Heading style


156: Expected: atx; Actual: atx_closed
Heading style


203: Expected: atx; Actual: atx_closed
Heading style


260: Expected: atx; Actual: atx_closed
Heading style


279: Expected: atx; Actual: atx_closed
Heading style


296: Expected: atx; Actual: atx_closed
Heading style


372: Expected: atx; Actual: atx_closed
Heading style


398: Expected: atx; Actual: atx_closed
Heading style


259: Expected: 1; Actual: 2
Multiple consecutive blank lines


54: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines


89: null
Fenced code blocks should be surrounded by blank lines


226: null
Fenced code blocks should be surrounded by blank lines


247: null
Fenced code blocks should be surrounded by blank lines


361: null
Fenced code blocks should be surrounded by blank lines


159: null
Lists should be surrounded by blank lines

README.md (11)

231: Expected: 0 or 2; Actual: 1
Trailing spaces


40: null
Fenced code blocks should be surrounded by blank lines


232: null
Lists should be surrounded by blank lines


44: null
Bare URL used


40: null
Fenced code blocks should have a language specified


50: null
Fenced code blocks should have a language specified


56: null
Fenced code blocks should have a language specified


64: null
Fenced code blocks should have a language specified


70: null
Fenced code blocks should have a language specified


4: null
Images should have alternate text (alt text)


5: null
Images should have alternate text (alt text)

Additional comments not posted (13)
README.md (1)

120-120: Ensure the URL is correct and accessible.

Verification successful

The URL in the code snippet is correct and accessible, as confirmed by the HTTP 200 status code.

  • URL: https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/
Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the accessibility of the URL used in the code.

# Test: Check if the URL is accessible. Expect: HTTP 200 status code.
curl -o /dev/null -s -w "%{http_code}\n" https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ | grep 200

Length of output: 116

Tests/UploadcareTests/UploadAPIIntegrationTests.swift (1)

65-65: Ensure the URL is correct and accessible for all test functions.

Also applies to: 95-95, 124-124, 150-150, 183-183, 249-249, 309-309, 376-376

Verification successful

The URL "https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/" is accessible and returns an HTTP 200 status code. This ensures that the URL is correct and accessible for all test functions.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the accessibility of the URL used in the test functions.

# Test: Check if the URL is accessible. Expect: HTTP 200 status code.
curl -o /dev/null -s -w "%{http_code}\n" https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ | grep 200

Length of output: 116

Documentation/Upload API.md (1)

122-122: Ensure the URL is correct and accessible for all API documentation examples.

Also applies to: 145-145, 206-206

Verification successful

The URL used in the API documentation examples is accessible and returns an HTTP 200 status code.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the accessibility of the URL used in the API documentation examples.

# Test: Check if the URL is accessible. Expect: HTTP 200 status code.
curl -o /dev/null -s -w "%{http_code}\n" https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ | grep 200

Length of output: 116

Tests/UploadcareTests/RESTAPIIntegrationTests.swift (9)

1012-1012: Ensure the new URL is correct and accessible.

Verification successful

The URL https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ is accessible and returns an HTTP 200 status code.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the accessibility of the new URL.

# Test: Check if the URL is accessible. Expect: HTTP 200 status code.
curl -o /dev/null -s -w "%{http_code}\n" https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ | grep 200

Length of output: 116


463-463: Ensure the new URL is correct and accessible.

Verification successful

The new URL is correct and accessible, as confirmed by the HTTP 200 status code.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the accessibility of the new URL.

# Test: Check if the URL is accessible. Expect: HTTP 200 status code.
curl -o /dev/null -s -w "%{http_code}\n" https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ | grep 200

Length of output: 116


746-746: Ensure the new URL is correct and accessible.

Verification successful

The new URL is correct and accessible, returning an HTTP 200 status code.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the accessibility of the new URL.

# Test: Check if the URL is accessible. Expect: HTTP 200 status code.
curl -o /dev/null -s -w "%{http_code}\n" https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ | grep 200

Length of output: 116


192-192: Ensure the new URL is correct and accessible.

Verification successful

The URL https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ is accessible and returns an HTTP 200 status code.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the accessibility of the new URL.

# Test: Check if the URL is accessible. Expect: HTTP 200 status code.
curl -o /dev/null -s -w "%{http_code}\n" https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ | grep 200

Length of output: 116


586-586: Ensure the new URL is correct and accessible.

Verification successful

The URL https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ is accessible and returns an HTTP 200 status code.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the accessibility of the new URL.

# Test: Check if the URL is accessible. Expect: HTTP 200 status code.
curl -o /dev/null -s -w "%{http_code}\n" https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ | grep 200

Length of output: 116


424-424: Ensure the new URL is correct and accessible.

Verification successful

The URL is accessible and returns an HTTP 200 status code, indicating that it is correct and reachable.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the accessibility of the new URL.

# Test: Check if the URL is accessible. Expect: HTTP 200 status code.
curl -o /dev/null -s -w "%{http_code}\n" https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ | grep 200

Length of output: 116


157-157: Ensure the new URL is correct and accessible.

Verification successful

The new URL is accessible and returns an HTTP 200 status code, confirming it is valid.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the accessibility of the new URL.

# Test: Check if the URL is accessible. Expect: HTTP 200 status code.
curl -o /dev/null -s -w "%{http_code}\n" https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ | grep 200

Length of output: 116


227-227: Ensure the new URL is correct and accessible.

Verification successful

The URL https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ is accessible and returns an HTTP 200 status code.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the accessibility of the new URL.

# Test: Check if the URL is accessible. Expect: HTTP 200 status code.
curl -o /dev/null -s -w "%{http_code}\n" https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ | grep 200

Length of output: 116


265-265: Ensure the new URL is correct and accessible.

Verification successful

The new URL is correct and accessible, returning an HTTP 200 status code.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the accessibility of the new URL.

# Test: Check if the URL is accessible. Expect: HTTP 200 status code.
curl -o /dev/null -s -w "%{http_code}\n" https://ucarecdn.com/46528d0d-323c-42d7-beab-2fdc5e7077ba/ | grep 200

Length of output: 116

Sources/Uploadcare/UploadAPI.swift (1)

492-492: The updated URL in the example code block is correct and aligns with the new data source.

@makoni makoni merged commit c986c38 into master May 29, 2024
7 checks passed
@makoni makoni deleted the makoni-patch-1 branch May 29, 2024 14:04
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.

None yet

2 participants