コード例 #1
0
ファイル: Coverage.cs プロジェクト: microsoft/fhir-codegen
        /// <summary>
        /// Deserialize JSON into a FHIR Coverage#Exemption
        /// </summary>
        public static void DeserializeJson(this Coverage.ExemptionComponent current, ref Utf8JsonReader reader, JsonSerializerOptions options)
        {
            string propertyName;

            while (reader.Read())
            {
                if (reader.TokenType == JsonTokenType.EndObject)
                {
                    return;
                }

                if (reader.TokenType == JsonTokenType.PropertyName)
                {
                    propertyName = reader.GetString();
                    if (Hl7.Fhir.Serialization.FhirSerializerOptions.Debug)
                    {
                        Console.WriteLine($"Coverage.ExemptionComponent >>> Coverage#Exemption.{propertyName}, depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}");
                    }
                    reader.Read();
                    current.DeserializeJsonProperty(ref reader, options, propertyName);
                }
            }

            throw new JsonException($"Coverage.ExemptionComponent: invalid state! depth: {reader.CurrentDepth}, pos: {reader.BytesConsumed}");
        }