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

Create a JSON-schema for the Devfile #11904

Closed
sleshchenko opened this issue Nov 12, 2018 · 4 comments
Closed

Create a JSON-schema for the Devfile #11904

sleshchenko opened this issue Nov 12, 2018 · 4 comments
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed. status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it.

Comments

@sleshchenko
Copy link
Member

Description

Create a JSON-schema for the Devfile.
It's a well-known standard for defining data formats. It will help with the discussion and allows to generate doc and API source code too.

@sleshchenko sleshchenko added status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it. kind/task Internal things, technical debt, and to-do tasks to be performed. team/platform labels Nov 12, 2018
@l0rd
Copy link
Contributor

l0rd commented Nov 12, 2018

@sleshchenko I have moved devfile to https://github.com/redhat-developer/devfile

@mshaposhnik
Copy link
Contributor

mshaposhnik commented Nov 16, 2018

Json validation library research:

  1. Officially recommended, supports latest v7 draft, but requires external repo set-up: https://github.com/everit-org/json-schema
  2. Popular one, a continuation of popular fge library https://github.com/java-json-tools/json-schema-validator Supports only v.4 draft ATM
  3. Also good one, but only draft v.4 support now (planned to update soon) https://github.com/networknt/json-schema-validator

Libraries 2 and 3 already have theirs CQ-s approved (or maybe just piggyback ir required)

Unfortunately, none of them supports validating yaml directly. So for phase 1 we can convert incoming yaml to JSON before validation.

So, for me lib no.2 looks most reasonable for this moment,

@mshaposhnik
Copy link
Contributor

The best way to generate POJO from schema is seems to be https://github.com/joelittlejohn/jsonschema2pojo library. We shall review it and start a CQ process if we found it acceptable for us.

@mshaposhnik
Copy link
Contributor

Will be closed together with merge of #11998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed. status/open-for-dev An issue has had its specification reviewed and confirmed. Waiting for an engineer to take it.
Projects
None yet
Development

No branches or pull requests

3 participants