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

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

Open
1 of 4 tasks
brennana opened this issue Jun 28, 2024 · 0 comments
Open
1 of 4 tasks

Comments

@brennana
Copy link

  • 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
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

No branches or pull requests

1 participant