Updated version 0.1 of Nikita - interface update

Petter Reinholdtsen pere at hungry.com
Tue Jan 31 14:59:34 CET 2017


[Thomas Sødring]
> I have added some code that now ensures the core publishes the services
> it supports. This is as per the Noark 5v4 standard and what Petter has
> been testing.

Very good!

> Hopefully this is the last thing that has to be done for the 0.1 release
> and we can now progress with a branch for 0.2. Let me know if you find
> any problems.

Recursing over "http://n5test.kxml.no/api/" lead me to
<URL: http://n5test.kxml.no/api/arkivstruktur/arkiv{?$filter&$orderby&$top&$skip&$search} >
which return this json document:

{"_links":[{"rel":"http://rel.kxml.no/noark5/v4/api/arkivstruktur/arkiv",
"href":"http://n5test.kxml.no/api/arkivstruktur/arkiv{?$filter&$orderby&$top&$skip&$search}",
"templated":true},
{"rel":"http://rel.kxml.no/noark5/v4/api/administrasjon/ny-arkivskaper",
"href":"http://n5test.kxml.no/api/arkivstruktur/ny-arkivskaper",
"templated":false},
{"rel":"http://rel.kxml.no/noark5/v4/api/arkivstruktur/arkivskaper",
"href":"http://n5test.kxml.no/api/arkivstruktur/arkivskaper{?$filter&$orderby&$top&$skip&$search}",
"templated":true},
{"rel":"http://rel.kxml.no/noark5/v4/api/arkivstruktur/arkivdel",
"href":"http://n5test.kxml.no/api/arkivstruktur/arkivdel{?$filter&$orderby&$top&$skip&$search}",
"templated":true},
{"rel":"http://rel.kxml.no/noark5/v4/api/arkivstruktur/klassifikasjonssystem",
"href":"http://n5test.kxml.no/api/arkivstruktur/klassifikasjonssystem{?$filter&$orderby&$top&$skip&$search}",
"templated":true},
{"rel":"http://rel.kxml.no/noark5/v4/api/arkivstruktur/klasse",
"href":"http://n5test.kxml.no/api/arkivstruktur/klasse{?$filter&$orderby&$top&$skip&$search}",
"templated":true},
{"rel":"http://rel.kxml.no/noark5/v4/api/arkivstruktur/mappe",
"href":"http://n5test.kxml.no/api/arkivstruktur/mappe{?$filter&$orderby&$top&$skip&$search}",
"templated":true},
{"rel":"http://rel.kxml.no/noark5/v4/api/arkivstruktur/registrering",
"href":"http://n5test.kxml.no/api/arkivstruktur/registrering{?$filter&$orderby&$top&$skip&$search}",
"templated":true},
{"rel":"http://rel.kxml.no/noark5/v4/api/arkivstruktur/basisregistrering",
"href":"http://n5test.kxml.no/api/arkivstruktur/basisregistrering{?$filter&$orderby&$top&$skip&$search}",
"templated":true},
{"rel":"http://rel.kxml.no/noark5/v4/api/arkivstruktur/dokumentbeskrivelse",
"href":"http://n5test.kxml.no/api/arkivstruktur/dokumentbeskrivelse{?$filter&$orderby&$top&$skip&$search}",
"templated":true},
{"rel":"http://rel.kxml.no/noark5/v4/api/arkivstruktur/dokumentobjekt",
"href":"http://n5test.kxml.no/api/arkivstruktur/dokumentobjekt{?$filter&$orderby&$top&$skip&$search}",
"templated":true}]}

Doing the same for
<URL: http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv/ >
return this json document:

  {
    "arkiv" : [ ]
  }

My test is looking for the _links field and fail when it is missing.
Should it exist, or is it optional?

Running my test on the latest version show this:

success: found base
success: correct content-type for base
success: found _links in json response
http://localhost:8092/noark5v4/login
success: able to log in
recursively discovering URLs from the root
success: MIME type application/vnd.noark5-v4+json;charset=UTF-8 should be application/vnd.noark5-v4+json for url .
success: MIME type application/vnd.noark5-v4+json;charset=UTF-8 should be application/vnd.noark5-v4+json for url http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/
failure: unable to fetch http://localhost:8092/noark5v4/hateoas-api/sakarkiv/
failure: unable to fetch http://localhost:8092/noark5v4/gui/
failure: unable to fetch http://localhost:8092/noark5v4/import-api/
success: MIME type application/vnd.noark5-v4+json;charset=UTF-8 should be application/vnd.noark5-v4+json for url http://localhost:8092/noark5v4/hateoas-api/arkivstruktur/arkiv/
7 successes, 3 failures
Traceback (most recent call last):
  File "./runtest", line 215, in <module>
    main()
  File "./runtest", line 212, in main
    t.runtests()
  File "./runtest", line 205, in runtests
    self.discover()
  File "./runtest", line 96, in discover
    for l in baseref['_links']:
KeyError: '_links'

-- 
Happy hacking
Petter Reinholdtsen


More information about the nikita-noark mailing list