swagger-api / swagger-api/swagger-editor

Typing assist causes errors

Open
#5,732 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
9.5k
Forks
2.4k
Avg merge
17h 15m
Merged PRs (30d)
18

Description

Scenario

In the Components/Schemas section of an OAS, take an existing object and add an attribute:

  • Move to the end of the object definition
  • Press Enter to get a new line and shift-Tab to outdent from the previous field.
  • Enter the field name newField: and Enter.
  • Enter type: string. The editor pops up a list of available types. The first type is array and it's pre-selected.
  • Press Enter. The editor replaces string with array

Result

There is a semantic error in the OAS.

This is one example. Other typing assist functions can be either annoying or harmful.

Workaround

Yes, by explicitly cancelling the autocomplete every single time.

Suggestion

Make all typing assist functions optional, so that the user can switch them all off with one button.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the problem in the Components/Schemas section of an OpenAPI document by adding a field and using the type autocomplete. Start by tracing the typing-assist behavior involved in replacing string with array; done should mean autocomplete no longer changes typed values unexpectedly and typing-assist functions can be disabled together.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, openapi
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.