Swagger-editor: First letter of keywords gets duplicated sometimes (ft/oas3)

Created on 21 Jul 2017  路  11Comments  路  Source: swagger-api/swagger-editor

Version: ft/oas3 branch, rebuilt manually
Chrome 59 on Windows 7

During input, the first letter of keys and values gets duplicated sometimes -- see the GIF below.

I'm typing example for a parameter. The first time, when the path is /, everything's OK (no duplicate characters). Then I change the path to /foo and type example again - and it's entered as eexam...

duplicate-characters

Spec:

openapi: 3.0.0
info:
  version: 0.0.0
  title: test

paths:
  /:
    post:
      parameters:
        - in: query
          name: foo
          schema:
            type: boolean
      responses:
        '200':
          description: OK

@shockey

OAS 3.0 bug 3.x

Most helpful comment

Good news! I'm pretty confident I've fixed this issue in #1544.

I'm going to keep this issue open for a little while longer.

All 11 comments

I've seen the issue with the current editor as well, just don't know how to reproduce it.

I'm experiencing this issue too. I was not able to found how to reproduce.

Not sure if it will reproduce everytime, but if I do this:

  • Insert some idented text "abc"
  • Select "abc" then delete it using backspace
  • Type "a" goes fine
  • Type "b", the "a" will be repeated, then b will be inserted. The text will look like: "aab"

It also gives the same errors in console.

I'm using http://editor.swagger.io, so I don't know the version but should be the latest.

ezgif-4-da1fa09334

Happens to me anytime I try to type a $ref.

Now I have to type it out in notepad, then paste back to the editor...

Also happens to me everytime I type a word. Not only the keywords also the values.

Getting

Uncaught TypeError: t.startsWith is not a function
    at i (swagger-editor-bundle.js:1814)
    at swagger-editor-bundle.js:1814
    at o (swagger-editor-bundle.js:1814)
    at i (swagger-editor-bundle.js:124586)
    at getCompletions (swagger-editor-bundle.js:127493)
    at Object.e.getCompletions (swagger-editor-bundle.js:124586)
    at swagger-editor-bundle.js:122410
    at Array.forEach (<anonymous>)
    at c.gatherCompletions (swagger-editor-bundle.js:122410)
    at c.updateCompletions (swagger-editor-bundle.js:122410)

using Chrome Version 61.0.3163.100 (Offizieller Build) (64-Bit).

Best Regards,
Kalle

Seeing this in the online editor as well, especially when using $ref under a get parameter

This ridiculous bug is preventing our team using the tool, could someone give attention here?

In the upcoming weeks we'll be taking a look at the auto-suggest and some other underlying features in the editor - hopefully this will get resolved as part of the process.

I have a theory: when our autosuggest code throws an uncaught error, Ace returns the current character as the resolved autosuggest value - so when live autocomplete fires and ends with an error, that buffer is appended to the value under the cursor, and the user sees a repeated character.

Good news! I'm pretty confident I've fixed this issue in #1544.

I'm going to keep this issue open for a little while longer.

I'll keep in touch. If occurs again I tell you.

Thank you for the fix!

Shipping the new version now - it will be live in about 15 minutes.

Thanks, everyone! Feel free to bump this thread if you run into this issue again.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rrberry picture rrberry  路  4Comments

ljerka picture ljerka  路  5Comments

confuser picture confuser  路  6Comments

marcopiraccini picture marcopiraccini  路  3Comments

delim29 picture delim29  路  4Comments