-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Update JSON package collection models #3067
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
Conversation
@@ -16,6 +16,8 @@ import struct Foundation.URL | |||
import PackageModel | |||
import SourceControl | |||
|
|||
fileprivate typealias JSONModel = JSONPackageCollectionModel.V1 |
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.
nice
public let _description: String? | ||
|
||
/// An array of keywords that the collection is associated with. | ||
public let keywords: [String]? |
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.
Is this optional so it doesn't get coded at all if empty, or is there a semantic difference? (noting for example that packages
below isn't optional — though admittedly we don't expect to have no packages the way there might be no keywords)
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.
It is optional so it doesn't get coded if nil
and deserialization doesn't fail if the key is missing. []
still gets coded.
packages
is required. Decode will fail if the key is missing or value is nil
. []
will get through and we will probably need validation to trap that case.
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.
The distinction between optional and required arrays makes a lot of sense. Thanks for explaining!
@yim-lee please rebase |
3ad2d24
to
96c4470
Compare
@swift-ci please smoke test |
public let _description: String? | ||
|
||
/// An array of keywords that the collection is associated with. | ||
public let keywords: [String]? |
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.
The distinction between optional and required arrays makes a lot of sense. Thanks for explaining!
What's the driver for using |
Yeah that was the reason I used |
Personally, I'd prefer using something like |
According to https://forums.swift.org/t/package-collection-format/42071 - Rename `summary` and `title` to `description` and `name`, respectively - Add `keywords` to `PackageCollection.Package` - Add `minimumPlatformVersions` to `PackageCollection.Package.Version` - Add `createdBy` to `PackageCollection` API models and tests are updated as well.
96c4470
to
2686496
Compare
@swift-ci please smoke test |
According to https://forums.swift.org/t/package-collection-format/42071 - Rename `title` to `name` - Consistent naming of `collection.overview` and `package.summary` instead of `description` - Add `keywords` to `Collection.Package` - Add `minimumPlatformVersions` to `Collection.Package.Version` - Add `createdBy` to `Collection` API models and tests are updated as well.
According to https://forums.swift.org/t/package-collection-format/42071
summary
andtitle
todescription
andname
, respectivelykeywords
toPackageCollection.Package
minimumPlatformVersions
toPackageCollection.Package.Version
createdBy
toPackageCollection
API models and tests are updated as well.