distributed-text-services / workshops

Public repositories for events organized by members of the DTS Tech Comittee and others
https://distributed-text-services.github.io/workshops/
Mozilla Public License 2.0
8 stars 2 forks source link

DTS API validator #16

Closed mromanello closed 2 years ago

mromanello commented 3 years ago

Proponent / Mentor

Matteo Romanello (@mromanello)

Brief Description

(I believe this came up during the hackathon info session, but I can't recall exactly by whom, sorry!) The idea is to develop a validation tool for the DTS API, along the lines of IIIF's validators for the image- and presentation-APIs (see https://github.com/IIIF/image-validator and https://github.com/IIIF/presentation-validator). Such a tool would be extremely valuable to developers for testing new DTS API implementations. The front-end can be kept extremely simple. The bulk of the work would be define validation tests based on the current specs.

Coding skills needed

Javascript, Python

Team members (if applicable)

Anyone with the above (or a comparable) set of skills is welcome to join this hack.

Grantglass commented 3 years ago

I would love to help out!

PietroLiuzzo commented 3 years ago

Hi @mromanello and @Grantglass ! As a user I would really love to have this. I do not find the IIIF one terribly useful however, if I may. beside checking json syntax and the ld part by making sure the context is there and is real I would love if a validator would inform me on

mromanello commented 3 years ago

Unfortunately, this hack idea did not take off (for lack of time). But I'm pasting here the preparatory notes/brainstorming I've jotted down while thinking about implementation.

Aspects to be tested/validated:


Implementation idea

Basically an adaption of the IIIF image validator

Core classes:

Class Description
TestSuite A collection of tests to run against a given DTS API. It has a run_test() method to run each test, as well as methods to find and list them (list_tests())
DTS_API Object responsible for building and making API calls to the DTS instance under validation. TestSuite.run_test() passes as input the test name and an instance of DTS_API
BaseTest Class that each test class will have to extend. Defines basic behaviour and information related to each test. Each test has a run() method which takes in input an instance of DTS_API and tests a certain aspect.
Validator This classes uses the Bottle Python framework to create an API/web service.
ValidationInfo object that gets passed around to each test by TestSuite, so that validation infos are stored in it via ValidationInfo.check()

Other stuff