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

XML hints in the Model view show "OrderedMap"

Open ponelat opened this issue 8 years ago • 24 comments

Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? 2.0/3.0.0 ( both )
Which Swagger-UI version? g23fd8a4d (aka 3.5.0)
How did you install Swagger-UI? petstore.swagger.io
Which browser & version? Chrome 60
Which operating system? Linux

Demonstration API definition

petstore.swagger.io ( using its default petstore 2.0 )

Expected Behavior

A UI indicating the XML behaviour that isn't a dump of the underlying immutablejs object. See screencap, look for OrderedMap

Current Behavior

image Note: xml: OrderedMap { "name": "photoUrl", "wrapped": true }string]

Possible Solution

A: xml: <photoUrl></photoUrl> string] B: xml: <photoUrl> (wrapped) string]

Context

I noticed the word "OrderedMap" and realized this is a dump of the underlying immutablejs object. Its a fragile solution, affected by changes to the underlying object as well as how future versions of ImmutableJs convert to a string. If not very performant.

ponelat avatar Nov 28 '17 10:11 ponelat

Yep, this is us not serializing the Immutable data correctly.

I wrangled something similar in extension value display ahead of v3.5.0 last week, in this commit: https://github.com/swagger-api/swagger-ui/pull/3945/commits/b42e2a7045543429fcaddc782d6103dfbabd2080

shockey avatar Nov 29 '17 07:11 shockey

i have the same issue,, is there any solution?

mmamyan avatar Jan 08 '19 07:01 mmamyan

@shockey help is needed. Please, look at this issue as soon as possible. Thank you.

mmamyan avatar Jan 15 '19 15:01 mmamyan

There is a workaround for the bug: pass XML you need as a string, e.g. "<tag>Quotes should be \" escaped</tag>"

bbagno avatar Jan 21 '19 12:01 bbagno

@bbagno In my application i see this in the models when i add XmlAttribue, XmlElement and XmlType annotations to the properties of the model...

mmamyan avatar Jan 21 '19 12:01 mmamyan

@shockey Can you look at this issue again? :\

mmamyan avatar Jan 25 '19 08:01 mmamyan

FYI: this is still in my work queue!

shockey avatar Mar 06 '19 02:03 shockey

I'm using springdoc-openapi 1.4.1 and I have this xml-stuff in my swagger-ui too. Any hint to ignore such internal data? In my case its the same as @mmamyan wrote. It have something todo with the Xml***annotations, I generate my classes with jaxb from xsd ... example: image And then I have something like this: image

ahoehma avatar Oct 22 '20 18:10 ahoehma

Same problem happens with example in JSON: image image

EduardSergeev avatar Apr 21 '21 01:04 EduardSergeev

The same, I see example: OrderedMap { ... } too, in the schema templates. It is annoyed to see the OrderedMap.

talatkuyuk avatar Oct 29 '21 04:10 talatkuyuk

Any update here? Or hints where to look more closely? If so I could try to fix this?

Maybe this here is related to https://github.com/swagger-api/swagger-core/issues/3153 ?

ahoehma avatar Dec 16 '21 10:12 ahoehma

Hi, any update ?

MrJuliuss avatar Apr 29 '22 07:04 MrJuliuss

Hi, any updates or ideas how to hide this?

MPiorunn avatar May 04 '22 07:05 MPiorunn

I have this problem too.. is this really still a thing after 4 years??

realjax avatar Sep 28 '22 07:09 realjax

Hi, I am not sure whether this issue is fixed already , You can disabling skipOperationExample flag during openapi-generator to hide the "example: OrderedMap"

soma0506 avatar Jan 24 '23 09:01 soma0506

still a problem.

conlaoch1 avatar Feb 22 '23 14:02 conlaoch1

Can this still be the same issue 6 years later? I'm also seeing "orderedMap" in my examples.

inkeytech avatar May 25 '23 11:05 inkeytech

same

C0DK avatar Jun 24 '23 09:06 C0DK

bump

alexu-hbk avatar Jul 26 '23 18:07 alexu-hbk

Someone? we are approaching the '6 year old bug, still not fixed' anniversary day rapidly!!

realjax avatar Aug 24 '23 13:08 realjax

I'm affected by this, six year old bug.

Kile-Asmussen avatar Feb 06 '24 11:02 Kile-Asmussen

I don't have this problem anymore. I'm using this stack:

springboot: 3.2.2 springdoc-openapi-starter-webmvc-ui: 2.3.0 springdoc-openapi-starter-webflux-ui: 2.3.0 javax.xml.bind:jaxb-api: 2.3.1 jdk17

I still generate some of my api-objects with jaxb and so there are referenced in my openapi schema ... So from my side everything is fine meanwhile :D

ahoehma avatar Feb 09 '24 07:02 ahoehma

Hey Can you assign this to me? I will try to fix the issue Thank you

cxx5208 avatar Feb 15 '24 07:02 cxx5208