Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

Type is not inferred from property items #668

Closed
jstoiko opened this issue Oct 28, 2019 · 0 comments
Closed

Type is not inferred from property items #668

jstoiko opened this issue Oct 28, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@jstoiko
Copy link
Contributor

jstoiko commented Oct 28, 2019

Similarly to the property properties of the "Object" type, the "Array" type should be inferred when the property items is defined (and the type is not set).

See two scenarios below:

#%RAML 1.0
title: My API
mediaType: application/json

/resource:
  post:
    body:
      items: integer
      example: [1, 2]

/other_resource:
  post:
    body:
      items:
        properties:
          Foo: integer
          Bar: string
      example:
        [{"Foo": 1, "Bar": "Qux"}]

Both validate fine in AMF:

$ java -jar amf-3.5.4.jar validate -in "RAML 1.0" -mime-in "application/yaml" -p "RAML" file:///tmp/api.raml
{
  "@type": "http://www.w3.org/ns/shacl#ValidationReport",
  "http://www.w3.org/ns/shacl#conforms": true
}


@jstoiko jstoiko added the bug label Oct 28, 2019
@jstoiko jstoiko added this to the 1.0.44 milestone Oct 28, 2019
@jpbelang jpbelang self-assigned this Oct 28, 2019
@jpbelang jpbelang modified the milestones: 1.0.44, 1.0.45 Oct 31, 2019
@jpbelang jpbelang closed this as completed Nov 3, 2019
juanchib pushed a commit to juanchib/raml-java-parser that referenced this issue Mar 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants