-
Notifications
You must be signed in to change notification settings - Fork 131
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
keep the original URL when decoding Download/ExternalLocationReference #621
keep the original URL when decoding Download/ExternalLocationReference #621
Conversation
@swift-ci Please test |
Sources/SwiftDocC/Model/Rendering/References/ExternalLocationReference.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDocC/Model/Rendering/References/ExternalLocationReference.swift
Outdated
Show resolved
Hide resolved
Sources/SwiftDocC/Model/Rendering/Tutorial/References/DownloadReference.swift
Show resolved
Hide resolved
} | ||
} | ||
|
||
static public func ==(lhs: DownloadReference, rhs: DownloadReference) -> Bool { |
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.
Off-topic but I wonder if it's possible to make an @EquatableIgnored
macro like: https://developer.apple.com/documentation/observation/observationignored...
@swift-ci Please test |
Sources/SwiftDocC/Model/Rendering/Tutorial/References/DownloadReference.swift
Show resolved
Hide resolved
7b62f5c
to
10edeec
Compare
@swift-ci Please test |
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.
🚀
@swift-ci Please test |
@swift-ci Please test |
Bug/issue #, if applicable: rdar://110536969
Summary
When a DownloadReference or ExternalLocationReference are decoded from JSON, they both modify URL when re-encoded back to JSON. This can cause issues if the URL is different from what either of these types use as their default (
/downloads/file
and the identifier, respectively). This PR tweaks the Codable logic for both of these types to always use the decoded URL when re-encoding.Dependencies
None
Testing
This bug manifests when the Render JSON is modified after rendering, and then re-encoded after the fact. As such, testing is restricted to the automated test added in this PR.
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded