swift icon indicating copy to clipboard operation
swift copied to clipboard

ERROR: Failed to parse JSON (description, state, changes_count)

Open Ph1Doc opened this issue 2 years ago • 0 comments

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?

Ph1Doc avatar Mar 28 '23 09:03 Ph1Doc