boolean tryConsumeParentProperties()

in extension-base/src/main/java/com/azure/autorest/extension/base/model/codemodel/Schema.java [314:361]


    boolean tryConsumeParentProperties(Schema schema, String fieldName, JsonReader reader) throws IOException {
        if (super.tryConsumeParentProperties(schema, fieldName, reader)) {
            return true;
        } else if ("type".equals(fieldName)) {
            schema.type = Schema.AllSchemaTypes.fromValue(reader.getString());
            return true;
        } else if ("summary".equals(fieldName)) {
            schema.summary = reader.getString();
            return true;
        } else if ("example".equals(fieldName)) {
            schema.example = reader.readUntyped();
            return true;
        } else if ("defaultValue".equals(fieldName)) {
            schema.defaultValue = reader.readUntyped();
            return true;
        } else if ("serialization".equals(fieldName)) {
            schema.serialization = SerializationFormats.fromJson(reader);
            return true;
        } else if ("serializationFormats".equals(fieldName)) {
            List<String> formats = reader.readArray(JsonReader::getString);
            schema.serializationFormats = formats == null ? null : new HashSet<>(formats);
            return true;
        } else if ("usage".equals(fieldName)) {
            List<SchemaContext> usage = reader.readArray(element -> SchemaContext.fromValue(element.getString()));
            schema.usage = usage == null ? null : new HashSet<>(usage);
            return true;
        } else if ("uid".equals(fieldName)) {
            schema.uid = reader.getString();
            return true;
        } else if ("$key".equals(fieldName)) {
            schema.$key = reader.getString();
            return true;
        } else if ("description".equals(fieldName)) {
            schema.description = reader.getString();
            return true;
        } else if ("apiVersions".equals(fieldName)) {
            schema.apiVersions = reader.readArray(ApiVersion::fromJson);
            return true;
        } else if ("deprecated".equals(fieldName)) {
            schema.deprecated = Deprecation.fromJson(reader);
            return true;
        } else if ("externalDocs".equals(fieldName)) {
            schema.externalDocs = ExternalDocumentation.fromJson(reader);
            return true;
        }

        return false;
    }