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

Implement Codable #9

Closed
wants to merge 0 commits into from
Closed

Conversation

NoahKamara
Copy link

What kind of change does this PR introduce?

  • Bug fix

What is the current behavior?

  • fetch return-type dependant on response
  • data is then decoded with JSONSerialization and instances created manually

What is the new behavior?

  • fetch returns response data directly, but will still attempt to decode and throw an error if the status code is not 2XX
  • data is decoded using JSONDecoder & Codable models

Additional context

  • also implemented updateBucket & updated createBucket, adding isPublic option
  • wrote test cases for all File & Bucket Api Operations
  • refactored StorageApis to use url instead of string when building endpoint urls
  • added some documentation to Api methods

Sources/SupabaseStorage/FileObject.swift Outdated Show resolved Hide resolved
Sources/SupabaseStorage/StorageBucketApi.swift Outdated Show resolved Hide resolved
Sources/SupabaseStorage/StorageBucketApi.swift Outdated Show resolved Hide resolved
Sources/SupabaseStorage/StorageError.swift Outdated Show resolved Hide resolved
Sources/SupabaseStorage/SupabaseStorage.swift Outdated Show resolved Hide resolved
Tests/SupabaseStorageTests/BucketAPITests.swift Outdated Show resolved Hide resolved
Tests/SupabaseStorageTests/Utility/StorageTests.swift Outdated Show resolved Hide resolved
Tests/SupabaseStorageTests/Utility/StorageTests.swift Outdated Show resolved Hide resolved
swiftformat Outdated Show resolved Hide resolved
.swiftformat Outdated Show resolved Hide resolved
@bryan-vh
Copy link
Contributor

@NoahKamara @GRSouza any updates on this PR?

@NoahKamara
Copy link
Author

@NoahKamara @GRSouza any updates on this PR?

I think I've implemented all requested changes. Waiting on review @GRSouza

@maail
Copy link
Contributor

maail commented Jun 27, 2023

@NoahKamara can fix the conflicts? And after that I can help take a look at the PR

@maail maail mentioned this pull request Jun 27, 2023
@m1guelpf
Copy link

any updates on this @GRSouza?

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

5 participants