apple / apple/swift-openapi-generator
Remove `Hashable` from `ServerSentEvent` and `ServerSentEventWithJSONData`
- Dominant language
- Swift
- Stars
- 2k
- Forks
- 182
- Avg merge
- 13h 28m
- Merged PRs (30d)
- 5
Description
### Motivation
In `ServerSentEventWithJSONData`, the generic `JSONDataType` may not guaranteed to conform to `Hashable`.
For example, there are a lot of packages can be found on GitHub for `JsonSchema`, and they all do not conform to `Hashable`.
And, the decoder or deserializer may not need Hashable constraint.
some packages list below:
1. https://github.com/kylef/JSONSchema.swift/blob/master/Sources/JSONSchema.swift
2. https://github.com/objecthub/swift-dynamicjson/blob/main/Sources/DynamicJSON/JSONSchema/JSONSchema.swift
### Proposed solution
Remove `Hashable` from `ServerSentEvent` and `ServerSentEventWithJSONData`.
### Alternatives considered
_No response_
### Additional information
_No response_
Contributor guide
Research direction
Search the project for the declarations and uses of ServerSentEvent and ServerSentEventWithJSONData, then inspect how their generic JSONDataType is constrained. Done means both types no longer require Hashable while their decoding or deserialization use remains valid.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100