Exemplo n.º 1
0
        public string GetResponseSchemaName()
        {
            switch (ResponseSchema)
            {
            case null:
                return("@undefined");

            case JValue value:
                return($"@{((string)value).ToLowerInvariant()}");

            case JObject schema:
                return((string)schema["title"]);

            default:
                throw new ApplicationException($"unexpected ResponseSchema type: {ResponseSchema.GetType()}");
            }
        }
        public string GetResponseSchemaName()
        {
            switch (ResponseSchema)
            {
            case null:
                return("@undefined");

            case string value:
                return($"@{value.ToLowerInvariant()}");

            case Dictionary <string, object?> schema:
                return((string?)schema["title"] ?? throw new NotSupportedException($"invalid ResponseSchema: {schema["title"]}"));

            default:
                throw new ApplicationException($"unexpected ResponseSchema type: {ResponseSchema.GetType()}");
            }
        }