swagger-editor icon indicating copy to clipboard operation
swagger-editor copied to clipboard

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

Open tim-lai opened this issue 2 years ago • 4 comments

@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 avatar Jun 24 '22 18:06 tim-lai

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.

tim-lai avatar Jul 27 '22 21:07 tim-lai

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: {}

hkosova avatar Oct 03 '22 20:10 hkosova

Subscribing =)

metaleap avatar Nov 14 '23 12:11 metaleap

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

2 years, any process ?

calvin2021y avatar Mar 07 '24 06:03 calvin2021y