/** * Returns <jk>true</jk> if the specified annotation contains all default values. * * @param a The annotation to check. * @return <jk>true</jk> if the specified annotation contains all default values. */ public static boolean empty(Body a) { if (a == null) return true; return allEmpty(a.description(), a.example(), a.examples(), a.api(), a.value()) && allFalse(a.required()) && empty(a.schema()); }
/** * Returns <jk>true</jk> if the specified annotation contains all default values. * * @param a The annotation to check. * @return <jk>true</jk> if the specified annotation contains all default values. */ public static boolean empty(Body a) { if (a == null) return true; return allEmpty(a.description(), a.example(), a.examples(), a.api(), a.value()) && allFalse(a.required()) && empty(a.schema()); }
/** * Returns <jk>true</jk> if the specified annotation contains all default values. * * @param a The annotation to check. * @return <jk>true</jk> if the specified annotation contains all default values. */ public static boolean empty(Body a) { if (a == null) return true; return allEmpty(a.description(), a.example(), a.examples(), a.api(), a.value()) && allFalse(a.required()) && empty(a.schema()); }
private ObjectMap merge(ObjectMap om, Body a) throws ParseException { if (empty(a)) return om; om = newMap(om); if (a.value().length > 0) om.putAll(parseMap(a.value())); if (a.api().length > 0) om.putAll(parseMap(a.api())); return om .appendSkipEmpty("description", resolve(a.description())) .appendSkipEmpty("x-example", resolve(a.example())) .appendSkipEmpty("x-examples", parseMap(a.examples())) .appendSkipFalse("required", a.required()) .appendSkipEmpty("schema", merge(om.getObjectMap("schema"), a.schema())) ; }
private ObjectMap merge(ObjectMap om, Body a) throws ParseException { if (empty(a)) return om; om = newMap(om); if (a.value().length > 0) om.putAll(parseMap(a.value())); if (a.api().length > 0) om.putAll(parseMap(a.api())); return om .appendSkipEmpty("description", resolve(a.description())) .appendSkipEmpty("x-example", resolve(a.example())) .appendSkipEmpty("x-examples", parseMap(a.examples())) .appendSkipFalse("required", a.required()) .appendSkipEmpty("schema", merge(om.getObjectMap("schema"), a.schema())) ; }
private ObjectMap merge(ObjectMap om, Body a) throws ParseException { if (empty(a)) return om; om = newMap(om); if (a.value().length > 0) om.putAll(parseMap(a.value())); if (a.api().length > 0) om.putAll(parseMap(a.api())); return om .appendSkipEmpty("description", resolve(a.description())) .appendSkipEmpty("x-example", resolve(a.example())) .appendSkipEmpty("x-examples", parseMap(a.examples())) .appendSkipFalse("required", a.required()) .appendSkipEmpty("schema", merge(om.getObjectMap("schema"), a.schema())) ; }