Skip to content

CheckRun.fromJson fails when passed CheckRun.toJson #412

Closed
@jtmcdole

Description

@jtmcdole

A newly created CheckRun with a conclusion of null (empty) will encode as "null". This fails parsing with "This level of check run conclusion is unimplemented" when passed the contents of a newly created checkrun.

class CheckRunConclusion extends EnumWithValue {
static const success = CheckRunConclusion._('success');
static const failure = CheckRunConclusion._('failure');
static const neutral = CheckRunConclusion._('neutral');
static const cancelled = CheckRunConclusion._('cancelled');
static const timedOut = CheckRunConclusion._('timed_out');
static const skipped = CheckRunConclusion._('skipped');
static const actionRequired = CheckRunConclusion._('action_required');
static const empty = CheckRunConclusion._(null);
const CheckRunConclusion._(super.value);
factory CheckRunConclusion._fromValue(String? value) {
if (value == null) {
return empty;
}
for (final level in const [
success,
failure,
neutral,
cancelled,
timedOut,
skipped,
actionRequired
]) {
if (level.value == value) {
return level;
}
}
throw Exception(
'This level of check run conclusion is unimplemented: $value.');
}
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy