Skip to content
This repository has been archived by the owner on Jan 21, 2024. It is now read-only.

Selecting one of suggested traits after "is" adds closing "]" #23

Closed
jisoldi opened this issue Jul 19, 2017 · 4 comments
Closed

Selecting one of suggested traits after "is" adds closing "]" #23

jisoldi opened this issue Jul 19, 2017 · 4 comments
Assignees

Comments

@jisoldi
Copy link

jisoldi commented Jul 19, 2017

When a trait suggestion after a 'is' selected the closing ']' is added but there ir no opening '['

With this example:

#%RAML 1.0
title: testConsumeFragment
traits: 
 secured: !include /exchange_modules/mulesoft-720/e2etrait_j3aczpxg882/1.0.0/trait.raml
/testResource:
  is: s

If you suggest after the last char, and select the 'secured' option, the text to insert is 'secured]', which results in this:

#%RAML 1.0
title: testConsumeFragment
traits: 
 secured: !include /exchange_modules/mulesoft-720/e2etrait_j3aczpxg882/1.0.0/trait.raml

/testResource:
  is: secured]
@dreamflyer dreamflyer self-assigned this Jul 20, 2017
@dreamflyer
Copy link
Contributor

@javok002, can not to reproduce, please provide more info, including at least your OS version and contents of '/exchange_modules/mulesoft-720/e2etrait_j3aczpxg882/1.0.0/trait.raml' file.

@leckoluck
Copy link

@dreamflyer I think that the problem is that the suggest after "is" is suggesting "secured" and it leaves an file with an error, because "is" expect to be an array:

#%RAML 1.0
title: testConsumeFragment
traits: 
 secured: !include /exchange_modules/mulesoft-720/e2etrait_j3aczpxg882/1.0.0/trait.raml

/testResource:
  is:
#%RAML 1.0
title: testConsumeFragment
traits: 
 secured: !include /exchange_modules/mulesoft-720/e2etrait_j3aczpxg882/1.0.0/trait.raml

/testResource:
  is: secured

It should suggest:

#%RAML 1.0
title: testConsumeFragment
traits: 
 secured: !include /exchange_modules/mulesoft-720/e2etrait_j3aczpxg882/1.0.0/trait.raml

/testResource:
  is: [secured]

It works fine, if you have something like
is: [

the content of the trait is:

#%RAML 1.0 Trait
usage: Apply this to any method that needs to be secured
description: Some requests require authentication.

headers:
  access_token:
    displayName: token
    description: Access token
    example: "10"
    required: true
protocols: HTTP
queryParameters:
  name: string
responses:
  200:
    body:
      application/json:
        type: string
        examples:
          example1: SSSL
          example2: 1AA

@dreamflyer
Copy link
Contributor

dreamflyer commented Aug 22, 2017

@javok002,
in my case,
before applying suggestion:
screen shot 2017-08-22 at 6 56 51 pm
after applying suggestion:
screen shot 2017-08-22 at 6 56 59 pm

So, once again, i need following info(or at least most of that):

  1. version of your OS.
  2. version of your Atom(if you talking about Atom).
  3. version of your Api-Workbench(if you talking about Api-Workbench).
  4. list of installed Atom packages.

Also, if it possible, please attach screenshots or, even better, gif animation of issue reproduction.

@jisoldi
Copy link
Author

jisoldi commented Dec 27, 2017

We found that we where ignoring the extra property in the suggestion in the API designer, so it was not a bug.

@jisoldi jisoldi closed this as completed Dec 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants