本文整理了Java中com.fasterxml.jackson.module.jsonSchema.JsonSchema.isObjectSchema()
方法的一些代码示例,展示了JsonSchema.isObjectSchema()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonSchema.isObjectSchema()
方法的具体详情如下:
包路径:com.fasterxml.jackson.module.jsonSchema.JsonSchema
类名称:JsonSchema
方法名:isObjectSchema
[英]determine if this JsonSchema is an ObjectSchema.
[中]确定此JsonSchema是否为ObjectSchema。
代码示例来源:origin: io.syndesis/inspector
/* default */ static void fetchPaths(final String context, final List<String> paths, final Map<String, JsonSchema> properties) {
for (final Entry<String, JsonSchema> entry : properties.entrySet()) {
final JsonSchema subschema = entry.getValue();
String path;
final String key = entry.getKey();
if (context == null) {
path = key;
} else {
path = context + "." + key;
}
if (subschema.isValueTypeSchema()) {
paths.add(path);
} else if (subschema.isObjectSchema()) {
fetchPaths(path, paths, ((ObjectSchema) subschema).getProperties());
}
}
}
代码示例来源:origin: io.syndesis.rest/rest-inspector
static void fetchPaths(final String context, final List<String> paths, final Map<String, JsonSchema> properties) {
for (final Entry<String, JsonSchema> entry : properties.entrySet()) {
final JsonSchema subschema = entry.getValue();
String path;
final String key = entry.getKey();
if (context == null) {
path = key;
} else {
path = context + "." + key;
}
if (subschema.isValueTypeSchema()) {
paths.add(path);
} else if (subschema.isObjectSchema()) {
fetchPaths(path, paths, ((ObjectSchema) subschema).getProperties());
}
}
}
代码示例来源:origin: dremio/dremio-oss
return;
if (schema.isObjectSchema()) {
followed.add(id);
objectExample(sb, maxlength, indent, schema, refs, followed, referenced, id);
代码示例来源:origin: com.github.terran4j/terran4j-commons-api2doc
public static ApiDataType toDataType(JsonSchema schema) {
if (schema == null) {
return null;
}
if (schema.isBooleanSchema()) {
return ApiDataType.BOOLEAN;
}
if (schema.isIntegerSchema()) {
return ApiDataType.INT;
}
if (schema.isStringSchema()) {
return ApiDataType.STRING;
}
if (schema.isNumberSchema()) {
return ApiDataType.NUMBER;
}
if (schema.isObjectSchema()) {
return ApiDataType.OBJECT;
}
if (schema.isArraySchema()) {
return ApiDataType.ARRAY;
}
return null;
}
代码示例来源:origin: dremio/dremio-oss
private void findRefs(JsonSchema schema, Map<String, JsonSchema> refs, Set<String> referenced) {
addRef(schema, refs);
if (schema instanceof ReferenceSchema) {
referenced.add(schema.get$ref());
} else if (schema.isArraySchema()) {
ArraySchema as = schema.asArraySchema();
if (as.getItems() != null) {
if (as.getItems().isSingleItems()) {
findRefs(as.getItems().asSingleItems().getSchema(), refs, referenced);
} else if (as.getItems().isArrayItems()) {
ArrayItems items = as.getItems().asArrayItems();
for (JsonSchema item : items.getJsonSchemas()) {
findRefs(item, refs, referenced);
}
} else {
throw new UnsupportedOperationException(as.getItems().toString());
}
}
} else if (schema.isObjectSchema()) {
ObjectSchema os = schema.asObjectSchema();
for (JsonSchema value : os.getProperties().values()) {
findRefs(value, refs, referenced);
}
}
}
内容来源于网络,如有侵权,请联系作者删除!