Skip to content

RAML Extension causes object arrays within resource type examples to contain duplicate members #2010

Open
@brennana

Description

@brennana
  • I'm submitting a ...

    • bug report
    • feature request
    • question
    • other
  • What is the current behavior?
    When extending a RAML document with a RAML Extension (even a trivial extension with no additional content), examples (included via a resource type) that contain arrays of object types will have their members duplicated.

Essentially, the following, used as an example in a resource type:

{ "prop1": "ok", "prop2": [{"id": "1"}, {"id": "2"}], "prop3": ["one", "two"] }

becomes this after document resolution:

prop1: ok
prop2:
  -
    id: "1"
  -
    id: "1"
  -
    id: "2"
  -
    id: "2"
prop3:
  - one
  - two

It does not appear that this bug occurs without the examples being embedded within a resource type. Examples defined in-line in a resource seem to be unaffected. Furthermore, arrays of scalar values, like strings, also seem to be unaffected.

  • If the current behavior is a bug, please provide the minimal steps to reproduce with AMF code. Please don't upload AMF code mixed with yours.

The following Gist contains a basic reproduction of this bug, using a base RAML document, and a trivial Extension: https://gist.github.com/brennana/ce8764131fc52d71e0829fb3b19471c7

  • What is the expected behavior?
    The examples should not contain duplicated object members within their arrays.

  • Please tell us about your environment:

    • AMF Version: tested with 5.4.8 and 5.5.2
    • AMF Distribution: JS
    • Operating System: linux x64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions