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

Update definitions schema to use a bespoke JSON Schema Version #257

Merged
merged 2 commits into from
Sep 3, 2019

Conversation

jeremyrickard
Copy link
Member

I originally tried to just reference the pieces of JSON schema we wanted, replacing things but since there are internal references inside of the json schema itself, it seemed cleaner to make a standalone schema, called definitions.schema.json and reference that.

Summary:

  • All the fields that were number before are integer
  • Removed number as a type, only integer
  • Updated the validation.sh script to reference the new file

Fixes #256

Copy link
Contributor

@carolynvs carolynvs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would help if we remind people on the default field as well that they cannot use a number and must use an integer. The text there says RECOMMENDED that a default value be valid against the associated schema really they have to follow schema there and use an integer there as well.

@@ -362,7 +362,7 @@ Fields:
The `definitions` section of the `bundle.json` defines set of JSONSchema definitions outlining how bundle configuration should be validated by a runtime.

Definitions have no utility on their own. They enable the runtime to validate parameters and outputs when used in combination with those features. Examples
of how to use `definitions` along with `parameters` and `outputs` can be seen in the [Parameters](#parameters) and [Outputs](#outputs) sections below.
of how to use `definitions` along with `parameters` and `outputs` can be seen in the [Parameters](#parameters) and [Outputs](#outputs) sections below. A `definition` must conform to both JSON Schema and Canonical JSON, therefore only `integer` numeric types are supported.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

100 internet points for not including "this is why we can't have nice things". 😂

Copy link
Member

@radu-matei radu-matei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jeremyrickard
Copy link
Member Author

I think it would help if we remind people on the default field as well that they cannot use a number and must use an integer. The text there says RECOMMENDED that a default value be valid against the associated schema really they have to follow schema there and use an integer there as well.

Good point! Will update to that.

@jeremyrickard jeremyrickard merged commit f362f13 into cnabio:master Sep 3, 2019
trishankatdatadog pushed a commit to trishankatdatadog/cnab-spec that referenced this pull request Jan 29, 2020
…o#257)

* Update definitions schema to use integer, remove `number` as a type

Fixes cnabio#256

* Incorporate suggestion

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>
trishankatdatadog added a commit to trishankatdatadog/cnab-spec that referenced this pull request Feb 5, 2020
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

overview and table of contents

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

move some text around

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

better TOC; abstract; introduction

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

fix small grammar issue

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

introduce repos

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

add some TODOs about image repos

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

some clarifications(?)

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

break things up a bit

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

simplifying assumption: one image registry <=> one image repo

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

minor language edits

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

WIP on traditional img repos

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

WIP

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

expand ToC

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

defer community image repos

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

some minor fixes

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

introduce idea of gradual security

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

add section on gradual security

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

WIP

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

end here today

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

separate security analysis

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

move things around a bit

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

wrap up traditional img repos

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

add a sentence

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

mention PEPs 458 & 480 for community img repos

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

add a reference

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

draft of signing workflows

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

minor language edits

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

defer a few things

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

one more thing to defer for now

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

add some important considerations

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

minor edits

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Clarify why bundle.json is mounted in the invocation image (cnabio#228)

* clarify why bundle.json is mounted in the invocation image

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

* remove link

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

add a CNAB Registry icon (cnabio#232)

![cnab-registry](https://user-images.githubusercontent.com/686194/61753147-2b387a80-ad63-11e9-8a63-f250bcdf06b0.png)

Adds a registry icon, which is a variant of the main CNAB logo.

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

add a CNAB Security icon (cnabio#231)

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Remove the `immutable` attribute from parameters

This removes the `immutable` attribute from parameters per Issue cnabio#229

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Remove wording about immutable parameters

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Remove fields from outputs

Signed-off-by: Radu M <root@radu.sh>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

fix(claim.schema.json): s/underay/underway

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

fix(claim.schema.json): s/descripton/description

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Adds information about the Specification Freeze (cnabio#238)

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Update 103-bundle-runtime.md

s/Instance/Installation

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

massively simplify 300

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

terminology updates

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

more fine-grained security levels

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

KISS: break up metadata repositories, signing, verification

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

fix(400-claims.md): add mention of the custom field in a claim (cnabio#255)

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Update README.md (cnabio#260)

Remove the OCI mailing list info

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Update definitions schema to use a bespoke JSON Schema Version (cnabio#257)

* Update definitions schema to use integer, remove `number` as a type

Fixes cnabio#256

* Incorporate suggestion

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

fix: corrected a typo

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

clearify wording on writeOnly

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

clarify what to do when multiple invocation images match a pattern

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

fix: clarify the wording on stateless actions

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Add clarification to `readOnly` definition

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Clarify parameters are encoded as json strings

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Clarify defaults for outputs and parameters (cnabio#270)

* Clarify how required and default interact

* Clarify output defaults

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Removed extra were

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

explain how claims treat parameters and credentials differently, and why (cnabio#267)

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Update contentDigest wording to clarify behavior (cnabio#261)

* Update contentDigest wording to clarify behavior

Fixes: cnabio#254

* Update markup for contentDigest

* Update comments

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Clarify upgrade version handling responsibility

Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Improve wording

Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Fix OWF Contributor License Agreement link (cnabio#276)

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Clarify failed action handling (cnabio#274)

Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

CNAB Core 1.0 GA

This commit marks the Working Group Acceptance (GA) of the CNAB Core 1.0 specification.

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Final Approval for CNAB Core 1.0 Specification

This commit indicates that the CNAB specification is now a published final version.

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Update README.md

Co-Authored-By: Carolyn Van Slyck <carolyn.vanslyck@microsoft.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Update 100-CNAB.md

Co-Authored-By: Carolyn Van Slyck <carolyn.vanslyck@microsoft.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Add mailing list (cnabio#283)

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Bump bundle schemaVersion to 1.0.0 (cnabio#278)

Signed-off-by: Christopher Crone <christopher.crone@docker.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Update 103-bundle-runtime.md

fixing the misleading description in the example of setting parameter value in file.

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Define host environment

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Make status.json a CNAB Output

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

fix: remove an unnecessary section

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

add bundleReference to the claim specification

Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

Update 400-claims.md

Co-Authored-By: Glyn Normington <gnormington@pivotal.io>
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

address @vdice feedback

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

remove .gitignore

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>

fix links per @chris-crone feedback

Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>
carolynvs added a commit to carolynvs/cnab-spec that referenced this pull request May 17, 2021
Revert the changes in cnabio#257 which updated the spec to disallow
non-integer values. We misunderstood the canonical json spec and were
using a library that didn't support numbers.

I have an open PRs for cnab-go which tested out switching to a library
that support numbers in canonical json and it works great.

* cnabio/cnab-go#247
* cnabio/cnab-go#248

So now fields such as default, maximum, minimum, etc can use numbers
again!

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
@carolynvs carolynvs mentioned this pull request May 17, 2021
carolynvs added a commit that referenced this pull request May 24, 2021
* Allow numbers again

Revert the changes in #257 which updated the spec to disallow
non-integer values. We misunderstood the canonical json spec and were
using a library that didn't support numbers.

I have an open PRs for cnab-go which tested out switching to a library
that support numbers in canonical json and it works great.

* cnabio/cnab-go#247
* cnabio/cnab-go#248

So now fields such as default, maximum, minimum, etc can use numbers
again!

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>

* Include integer and number in primitives list

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update schema to be consistent with limitations of canonical json
4 participants