Skip to content

XML hints in the Model view show "OrderedMap" #3954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ponelat opened this issue Nov 28, 2017 · 24 comments · May be fixed by #10370
Open

XML hints in the Model view show "OrderedMap" #3954

ponelat opened this issue Nov 28, 2017 · 24 comments · May be fixed by #10370

Comments

@ponelat
Copy link
Contributor

ponelat commented Nov 28, 2017

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.

@shockey
Copy link
Contributor

shockey commented Nov 29, 2017

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: b42e2a7

@mmamyan
Copy link

mmamyan commented Jan 8, 2019

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

@mmamyan
Copy link

mmamyan commented Jan 15, 2019

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

@bbagno
Copy link

bbagno commented Jan 21, 2019

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

@mmamyan
Copy link

mmamyan commented Jan 21, 2019

@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
Copy link

mmamyan commented Jan 25, 2019

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

@shockey
Copy link
Contributor

shockey commented Mar 6, 2019

FYI: this is still in my work queue!

@ahoehma
Copy link

ahoehma commented Oct 22, 2020

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

@EduardSergeev
Copy link

Same problem happens with example in JSON:
image
image

@talatkuyuk
Copy link

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

@ahoehma
Copy link

ahoehma commented Dec 16, 2021

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

Maybe this here is related to swagger-api/swagger-core#3153 ?

@MrJuliuss
Copy link

Hi, any update ?

@MPiorunn
Copy link

MPiorunn commented May 4, 2022

Hi, any updates or ideas how to hide this?

@realjax
Copy link

realjax commented Sep 28, 2022

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

@soma0506
Copy link

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

@conlaoch1
Copy link

still a problem.

@inkeytech
Copy link

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

@C0DK
Copy link

C0DK commented Jun 24, 2023

same

@alexu-hbk
Copy link

bump

@realjax
Copy link

realjax commented Aug 24, 2023

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

@Kile-Asmussen
Copy link

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

@ahoehma
Copy link

ahoehma commented Feb 9, 2024

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

@cxx5208
Copy link

cxx5208 commented Feb 15, 2024

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

@HavaElboim
Copy link

Any update on this bug? I'm still seeing OrderedMap in an object example.

@userwiths userwiths linked a pull request Mar 15, 2025 that will close this issue
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.