Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable using the Type API instead of Cordra to get a profiles JSON Schema. #104

Open
Pfeil opened this issue Feb 1, 2023 · 4 comments · May be fixed by #218
Open

Enable using the Type API instead of Cordra to get a profiles JSON Schema. #104

Pfeil opened this issue Feb 1, 2023 · 4 comments · May be fixed by #218
Assignees
Labels
enhancement New feature or request

Comments

@Pfeil
Copy link
Member

Pfeil commented Feb 1, 2023

Currently, we get the Schemas for the types from Cordra directly. There is a Type API available which we should consider supporting: http://typeapi.pidconsortium.net/docs#/

Introducing a configuration option to choose one of the ways to do it should be considered.

@Pfeil Pfeil added the enhancement New feature or request label Feb 1, 2023
@DevPJ9
Copy link

DevPJ9 commented Feb 1, 2023

Hello @Pfeil I would like to work on this.

@Pfeil
Copy link
Member Author

Pfeil commented Feb 7, 2023

Hi, thank you for your interest.

I haven't put a lot of effort into this issue so far, but I think before this can be implemented, it needs some refactoring in the validation architecture, as the Type API is involved in validation of PID Records. After some refactoring, this issue can actually be worked on. You may choose to do so, but actually I do not yet have a good/final plan.

To see which parts are currently doing validation, you may follow the call of the "create" REST endpoint. You will see that Validation mainly involves the TypeValidationUtils, TypeDefinition, PIDRecord, and the TypeRegistry classes.

I think what we require is an interface ValidationInfoProvider which represents different sources of validation information. Each ValidationInfoProvider should be able to execute a ValidationStrategy (currently implemented as a simple function), as we want to be able to have different ways/constraints/levels for validation. So far, I would assume that Provider and Strategy are selected by configuration, not at runtime (e.g., via different REST endpoints).

The new API then would be a new ValidationInfoProvider Implementation with the same strategy as the current one (see executeValidationStrategy).

This is probably the issue with most work to do, so far :). Do you have a special interest in the Typed PID Maker or a personal need/priority on this issue?

@Lienhop
Copy link

Lienhop commented Feb 10, 2023

Hi @Pfeil. We are currently fully reworking the TypeAPI, so if there are any features you would like to have included there, let us know!

@Pfeil
Copy link
Member Author

Pfeil commented Feb 10, 2023

Hi, thank you for the hint! I guess this is also an indicator to wait with this issue a little until this is done. :) Currently, I do not have additional feature requests or suggestions, but I will keep it in mind. Some minor comments on the current API:

  • Having a version-scoped API sooner or later would be great (like, api/v1/dtype/... or so. This way you can change the API without breaking current user's implementations :) )
  • So far, we only need the JSON-Schema representation of a profile (or its types; currently we validate each type and check the profile information using the given DTR representation). Any other format with good validation tooling will also work, but I guess JSON Schema is the best choice here.

@Pfeil Pfeil self-assigned this Nov 15, 2024
@Pfeil Pfeil linked a pull request Dec 2, 2024 that will close this issue
23 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants