gayanw
(Gayan W.)
June 6, 2017, 12:58pm
1
In the SwaggerSpecficationCreator , path
of a sub-resource is considered as it’s name.
For example the name of LocationAttributeResource (which is a sub-resource of Location) is considered just attribute
, which I believe is wrong.
@SubResource(parent = LocationResource1_9.class, path = "attribute", supportedClass = LocationAttribute.class, supportedOpenmrsVersions = {
"1.9.*", "1.10.*", "1.11.*", "1.12.*", "2.0.*", "2.1.*", "2.2.*" })
public class LocationAttributeResource1_9 extends BaseAttributeCrudResource1_9<LocationAttribute, Location, LocationResource1_9> {
Shouldn’t the name ideally be location/attribute
(parent-name/sub-name)?
And these path values are passed to other methods as resourceNames which caused problems. For example passing attribute
as resourceName to the below method would possibly cause mis-matches.
/**
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
*
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
* graphic logo is a trademark of OpenMRS Inc.
*/
package org.openmrs.module.webservices.docs.swagger;
import io.swagger.models.Contact;
import io.swagger.models.ExternalDocs;
import io.swagger.models.Info;
import io.swagger.models.License;
import io.swagger.models.Model;
import io.swagger.models.ModelImpl;
import io.swagger.models.Operation;
import io.swagger.models.Path;
import io.swagger.models.RefModel;
This file has been truncated. show original
dkayiwa
(Daniel Kayiwa)
June 11, 2017, 8:31pm
2
@pascal what is your take on this?