"Swagger Resolver" Errors in later versions of Reff app

Tags: #<Tag:0x00007fe2dd34f4c8> #<Tag:0x00007fe2dd34f3b0>

I have now been seeing this in the later versions of reff app. Swagger can’t resolve mappings to some resource documentations in the document yet they exist. Example is

Resolver error<small> at paths./attachment.post.parameters.0.schema.$ref</small>

Could not resolve reference because of: Could not resolve pointer: /definitions/AttachmentCreate does not exist in document

Now idealy the AttachmentCreate (POST Attachment) API exist in the Document. i wonder what could be the cause of these erros ? was there any work done in swagger ,or some thing like verson upgrade etc and could be the cause of this. i havent taken time to investigate this more deeper.

see screen shot

.This can easily be reproduced on all our demo servers

cc @dkayiwa @mksd @burke

could it be because , for example in the AtachmentResource Swagger was not fully configured in the resource ?

Hi @mozzy

I am also trying to figure out how the rest module is working in openmrs.

Isn’t AttachmentResource1_10.java file should be included in the rest web service module to be exposed as a webservice ?

And as far as I am got to know the resource classes should override the base methods provided by the swagger interface

getGETModel getCREATEModel getUPDATEModel

I don’t see it in the attachment resource class in modo-1.10.

as long as any other module depends on the Rest module , it can define Resources on its own, without defining the Resources in the Rest Module its self.

true , for the Resource to be included in the swagger document, i deally it would overide those methods provided in the swager interface. However it seems we have a default behaviour ,where resources can be documented without overiding the swager interface methods. But that may seem to bring about some few issues like what i reported here

Hi @mozzy

Thanks for the clarification.

Oh okays.Btw Is there any resources other than AtachmentResource that’s working fine with this approach I just want to get an idea that’s why

Am assuming you got a chance to look at this: https://wiki.openmrs.org/display/docs/Documenting+REST+Resources


.Idealy the swager interface Methods are not overidden in the AtachmentResource , However it shows up in the swagger document.

Looking at this statement,
It is not mandatory that you override these methods. However if not, their proper definitions won't appear in OpenMRS Swagger Spec.

do we have a default behavior for the resources to show up in the swager document (Though not in their proper format) even when the swagger interface methods are not overidden? and could that be the cause of the Resolver errors above ??