swagger-api / swagger-editor

Swagger Editor
https://editor.swagger.io
Apache License 2.0
8.94k stars 2.26k forks source link

SwaggerEditor@next: url prop display persists in UI after definition change #3188

Open tim-lai opened 2 years ago

tim-lai commented 2 years ago

@tim-lai commented on Tue May 10 2022

Steps to reproduce:

  1. load default SwaggerEditor@next
  2. File -> Import File, and/or File -> Import Url
  3. Observe that URL in the Info component of SwaggerUI does not change

Question: if we were to clear the url prop in SwaggerUI upon loading a new definition, can we be sure that it would always be intended behavior?

screenshot:

Screen Shot 2022-05-10 at 2 06 05 PM

Note, this issue precedes #3187 , before the editor-persistence plugin was implemented

tim-lai commented 2 years ago

Suggestion: wrap SwaggerUI's InfoUrl and possibly also InfoBasePath component, to return null. Could also provide an override option for the wrapped component(s) whether or not to return null, which lets users decide.

In legacy SwaggerEditor default, the url prop is not used in the standalone site, so this does not display.

hkosova commented 2 years ago

Alternative step 2 for the repro (just in case):

  1. Ctrl + A, delete, then either start typing a new spec manually or paste the following:
    openapi: 3.0.0
    info:
    title: test
    version: 1.0.0
    paths: {}
metaleap commented 1 year ago

Subscribing =)

calvin2021y commented 8 months ago

Test for https://editor-next.swagger.io , still not fix yet.

2 years, any process ?