Skip to content

schema: define "negative" schema examples #83

Closed

Description

@stevvooe

We have several examples of well-formed JSON objects that pass schema validation, but no examples that fail. We need several for the following reason:

  1. Ensure that schema validation is actually working.
  2. Clarify aspects of the specification.

Ideally, these could be part of the specification and marked as bad, in congruence with the approach of having the examples validated.

Please see #81 (comment).

cc @s-urbaniak

Activity

  1. changed the title [-]Define [/-] [+]schema: define "negative" schema examples[/+] on May 23, 2016
  2. vbatts commented on May 23, 2016

    @vbatts
    Member

    +1 though it could mean some churn until a 1.0

  3. stevvooe commented on May 23, 2016

    @stevvooe
    ContributorAuthor

    We can avoid making a bunch of these till before 1.0. For now, we just need to make the schema validation is operating correctly.

  4. wking commented on May 23, 2016

    @wking
    Contributor

    On Mon, May 23, 2016 at 02:18:50PM -0700, Stephen Day wrote:

    For now, we just need to make the schema validation is operating
    correctly.

    That's probably just “test any approach that someone questions”, and
    not “test all instances of all approaches”. So @stevvooe wonders
    about $ref between files, and we give that one test case. I expect
    that will be light enough to be feasible even with pre-1.0 churn.

  5. wking commented on May 23, 2016

    @wking
    Contributor
  6. philips commented on May 24, 2016

    @philips
    Contributor

    Unless someone volunteers earlier I am making this a post-v1.0.0 milestone.

  7. added this to the post-v1.0.0 milestone on May 24, 2016
  8. stevvooe commented on May 25, 2016

    @stevvooe
    ContributorAuthor

    @philips We can't release a 1.0 without ensuring validation is correct.

  9. philips commented on May 25, 2016

    @philips
    Contributor

    @stevvooe OK, are you volunteering to do that work?

  10. stevvooe commented on May 25, 2016

    @stevvooe
    ContributorAuthor

    @philips Looking into a fix but here is what I found:

    1. Type validation seems to work. For example, if you change an int to a string, it is caught.

    2. The regular expression validation seems to be broken. For example, the following passes, when there are not accepted characters:

      diff --git a/manifest.md b/manifest.md
      index 0b81f1d..1660f12 100644
      --- a/manifest.md
      +++ b/manifest.md
      @@ -104,7 +104,7 @@ A client will distinguish a manifest list from an image manifest based on the Co
       {
         "mediaType": "application/vnd.oci.image.manifest.v1+json",
         "size": 7143,
      -      "digest": "sha256:e692418e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f",
      +      "digest": "----sha256:e69241---8e4cbaf90ca69d05a66403747baa33ee08806650b51fab815ad7fc331f",
         "platform": {
           "architecture": "ppc64le",
           "os": "linux

    We may be able to go live with a 1.0 in this condition, but there could be issues.

  11. vbatts commented on Jun 1, 2016

    @vbatts
    Member

    Those can be tricky. When I was doing the schema for runtime-spec, I had to constantly test passing and failing cases for each field. But that was all by hand.

  12. added a commit that references this issue on Jun 8, 2016
    c04fca2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions