swift
swift copied to clipboard
ERROR: Failed to parse JSON (description, state, changes_count)
Hello
we started using Danger-swift on Gitlab and met a number of problems when parse JSON
-
description
ERROR: Failed to parse JSON: valueNotFound(Swift.String, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "danger", intValue: nil), CodingKeys(stringValue: "gitlab", intValue: nil), CodingKeys(stringValue: "mr", intValue: nil), CodingKeys(stringValue: "description", intValue: nil)], debugDescription: "Expected String value but found null instead.", underlyingError: nil)) -
state
ERROR: Failed to parse JSON: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "danger", intValue: nil), CodingKeys(stringValue: "gitlab", intValue: nil), CodingKeys(stringValue: "mr", intValue: nil), CodingKeys(stringValue: "author", intValue: nil), CodingKeys(stringValue: "state", intValue: nil)], debugDescription: "Cannot initialize State from invalid String value ldap_blocked", underlyingError: nil)) -
changes_count
ERROR: Failed to parse JSON: valueNotFound(Swift.String, Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "danger", intValue: nil), CodingKeys(stringValue: "gitlab", intValue: nil), CodingKeys(stringValue: "mr", intValue: nil), CodingKeys(stringValue: "changes_count", intValue: nil)], debugDescription: "Expected String value but found null instead.", underlyingError: nil))https://docs.gitlab.com/ee/api/merge_requests.html#empty-api-fields-for-new-merge-requests
Can you make these parameters Optional?