Updated controller for findOne

Thomas Sødring thomas.sodring at hioa.no
Mon Jan 30 21:01:44 CET 2017


Hi Petter,

On 01/30/2017 02:48 PM, Petter Reinholdtsen wrote:
> [Thomas Sødring]
>> I just pushed an update that makes sure the findOne in the controllers
>> work. Some controllers were looking for table id, some were looking for
>> systemId. It's all consistent with systemId now. I also updated the
>> run_curl.sh script to retrieve some of the Noark entities that were
>> created  so that you can see both POST and GET commands are working.
> Very good.  But when I try to visit
> <URL: http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv > I
> get a 500 internal error with a long backtrace.  Is it working for you?

I'm going to be open about all bugs and problems, when I can solve them
and when I can't. You can't hide anything with opensource anyway :) and
git has the history!  It took me a while to figure out why this was
happening, but I get it now.

The ClassificationSystemController had a bug in it. It should have
mapped the findOne function to

http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/klassifikasjonsystem/{systemId}

but I had left out "klassifikasjonsystem" so it was mapping the findOne
function to:

http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/{systemId}

So then when you hit the core with

http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv

it interpreted "arkiv" as being the systemId

Either way it should not have resulted in a 500 response as "arkiv"
should have resulted in a NoarkEntityNotfound and returned a 404 so
something is up in there.  This also explains why I couldn't find a
mapping from

http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv

to a method, in the list of mappings.

I will have another go finetuning the interface and testing it and will
be better able to pickup such subtle problems. Thanks for finding it BTW!

I am currently working on what should be returned when you hit:

http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/

All I need is to glue some findAll methods for each of the references
returned here. I hope to finish that in the morning and then unless you
have any more bugs I'll start the 0.2 branch.

 - Tom







More information about the nikita-noark mailing list