Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ATT-55: Remove the manual methods used for swagger spec generation #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading