Map<String, Model> models = ModelConverters.getInstance().read(responseClass); for (String key : models.keySet()) { final Property schema = new RefProperty().asDefault(key); if (apiResponse.responseContainer().equals("List")) { response.schema(new ArrayProperty(schema));
Property responseProperty = RESPONSE_CONTAINER_CONVERTER.withResponseContainer(responseContainer, new RefProperty().asDefault(key)); operation.response(responseCode, new Response() .description("successful operation")
Property responseProperty = RESPONSE_CONTAINER_CONVERTER.withResponseContainer(responseContainer, new RefProperty().asDefault(key));
if (value != null && !value.isEmpty()) { operation.response(FORBIDDEN.code(), new Response() .schema(new RefProperty("ErrorMessage")) .description(value + " is invalid"));
public Datum(String definitionName) { super(); property("data", new RefProperty(definitionName)); }
@Override public Model getUPDATEModel(Representation representation) { return new ModelImpl() .property("name", new RefProperty("#/definitions/ConceptNameCreate")) .property("names", new ArrayProperty(new RefProperty("#/definitions/ConceptNameCreate"))) .property("descriptions", new ArrayProperty(new RefProperty("#/definitions/ConceptDescriptionCreate"))); }
@Override public Model getCREATEModel(Representation rep) { return ((ModelImpl) super.getCREATEModel(rep)) .property("privileges", new ArrayProperty(new RefProperty("#/definitions/PrivilegeCreate"))) .property("inheritedRoles", new ArrayProperty(new RefProperty("#/definitions/RoleCreate"))); }
@Override public Model getCREATEModel(Representation rep) { return ((ModelImpl) super.getCREATEModel(rep)) .property("states", new ArrayProperty(new RefProperty("#/definitions/ProgramenrollmentStateCreate"))) .property("outcome", new RefProperty("#/definitions/ConceptCreate")); }
private RefProperty refProperty(PropertyDescription pd) { ModelImpl model = (ModelImpl) this.byKind.get(pd.kind); if (model == null) { model = load(pd.fieldDescriptions.entrySet()); model.setName(pd.kind); this.byKind.put(pd.kind, model); } return new RefProperty(pd.kind); }
@Override public Model getUPDATEModel(Representation rep) { return new ModelImpl() .property("description", new StringProperty()) .property("privileges", new ArrayProperty(new RefProperty("#/definitions/PrivilegeCreate"))) .property("inheritedRoles", new ArrayProperty(new RefProperty("#/definitions/RoleCreate"))); }
@Override public Model getGETModel(Representation rep) { return ((ModelImpl) super.getGETModel(rep)) .property("modules", new ArrayProperty(new RefProperty("#/definitions/ModuleGetRef"))) .property("action", new EnumProperty(ModuleAction.Action.class)); }
@Override public Model getUPDATEModel(Representation rep) { return new ModelImpl().property("visitType", new RefProperty("#/definitions/VisittypeCreate")) .property("startDatetime", new DateProperty()) .property("location", new RefProperty("#/definitions/LocationCreate")) .property("indication", new RefProperty("#/definitions/ConceptCreate")) .property("stopDatetime", new DateProperty()) .property("encounters", new ArrayProperty(new RefProperty("#/definitions/EncounterCreate"))) .property("attributes", new ArrayProperty(new StringProperty())); //FIXME type }
public Data(String definitionName) { super(); property("data", new ArrayProperty().items(new RefProperty(definitionName))); }
@Override public Model getCREATEModel(Representation rep) { ModelImpl model = new ModelImpl() .property("person", new StringProperty().example("uuid")) .property("identifiers", new ArrayProperty(new RefProperty("#/definitions/PatientIdentifierCreate"))) .required("person").required("identifiers"); if (rep instanceof FullRepresentation) { model .property("person", new RefProperty("#/definitions/PersonCreate")); } return model; }
@Override public Model getCREATEModel(Representation rep) { ModelImpl model = ((ModelImpl) super.getCREATEModel(rep)) .property("outcomesConcept", new StringProperty().example("uuid")); if (rep instanceof FullRepresentation) { model .property("outcomesConcept", new RefProperty("#/definitions/ConceptCreate")); } return model; }
@Override public Model getCREATEModel(Representation rep) { ModelImpl model = new ModelImpl() .property("patient", new StringProperty().example("uuid")) .required("patient"); if (rep instanceof FullRepresentation) { model .property("patient", new RefProperty("#/definitions/PatientCreate")); } return model; }
@Override public Model getCREATEModel(Representation rep) { return ((ModelImpl) super.getCREATEModel(rep)) .property("problem", new RefProperty("#/definitions/ConceptCreate")) .property("modifier", new EnumProperty(ProblemModifier.class)) .property("sortWeight", new DoubleProperty()) .required("problem"); }
@Override public Model getCREATEModel(Representation rep) { return ((ModelImpl) super.getCREATEModel(rep)) .property("fieldType", new RefProperty("#/definitions/FieldtypeCreate")) .property("selectMultiple", new BooleanProperty()._default(false)) .property("concept", new RefProperty("#/definitions/ConceptCreate")) .property("tableName", new StringProperty()) .property("attributeName", new StringProperty()) .property("defaultValue", new StringProperty()) .required("fieldType").required("selectMultiple"); }
@Override public Model getCREATEModel(Representation rep) { ModelImpl model = ((ModelImpl) super.getCREATEModel(rep)) .property("concept", new StringProperty().example("uuid")) .property("retired", new BooleanProperty()) .required("concept").required("description"); if (rep instanceof FullRepresentation) { model .property("concept", new RefProperty("#/definitions/ConceptCreate")); } return model; }
@Override public Model getCREATEModel(Representation rep) { return ((ModelImpl) super.getCREATEModel(rep)) .property("format", new StringProperty().example("java.lang.String")) .property("foreignKey", new IntegerProperty()) .property("sortWeight", new DoubleProperty()) .property("searchable", new BooleanProperty()._default(false)) .property("editPrivilege", new RefProperty("#/definitions/PrivilegeCreate")) .required("description"); }