Skip to content

Commit

Permalink
ATT-55: Remove the manual methods used for swagger spec generation
Browse files Browse the repository at this point in the history
  • Loading branch information
mherman22 committed Dec 6, 2024
1 parent c0609d5 commit 0c6b1d1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
import javax.activation.MimetypesFileTypeMap;
import javax.imageio.ImageIO;

import io.swagger.models.Model;
import io.swagger.models.ModelImpl;
import io.swagger.models.properties.DateProperty;
import io.swagger.models.properties.StringProperty;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils;
Expand All @@ -41,7 +37,6 @@
import org.openmrs.module.attachments.ComplexObsSaver;
import org.openmrs.module.attachments.obs.Attachment;
import org.openmrs.module.attachments.obs.ValueComplex;
import org.openmrs.module.webservices.docs.swagger.core.property.EnumProperty;
import org.openmrs.module.webservices.rest.web.ConversionUtil;
import org.openmrs.module.webservices.rest.web.RequestContext;
import org.openmrs.module.webservices.rest.web.RestConstants;
Expand Down Expand Up @@ -247,20 +242,6 @@ public DelegatingResourceDescription getCreatableProperties() {
return description;
}

@Override
public Model getCREATEModel(Representation rep) {
return new ModelImpl().property("comment", new StringProperty()).property("dateTime", new DateProperty())
.property("filename", new StringProperty()).property("bytesMimeType", new StringProperty())

.property("bytesContentFamily", new EnumProperty(AttachmentsConstants.ContentFamily.class))
.property("complexData", new StringProperty(StringProperty.Format.URI));
}

@Override
public Model getUPDATEModel(Representation rep) {
return getCREATEModel(rep);
}

@Override
public DelegatingResourceDescription getRepresentationDescription(Representation rep) {
DelegatingResourceDescription description = new DelegatingResourceDescription();
Expand All @@ -274,15 +255,6 @@ public DelegatingResourceDescription getRepresentationDescription(Representation
return description;
}

@Override
public Model getGETModel(Representation rep) {
ModelImpl model = (ModelImpl) super.getGETModel(rep);
return model.property("uuid", new StringProperty()).property("dateTime", new DateProperty())
.property("filename", new StringProperty()).property("comment", new StringProperty())
.property("bytesMimeType", new StringProperty())
.property("bytesContentFamily", new EnumProperty(AttachmentsConstants.ContentFamily.class));
}

/**
* Voids the encounter if it contains no non-voided obs.
*
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

<properties>
<openMRSVersion>2.2.0</openMRSVersion>
<webservices.restVersion>2.33.0</webservices.restVersion>
<webservices.restVersion>2.47.0-SNAPSHOT</webservices.restVersion>
<serialization.xstreamVersion>0.2.8</serialization.xstreamVersion>
<javaxVersion>3.0.1</javaxVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down

0 comments on commit 0c6b1d1

Please sign in to comment.