Skip to content

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

Open
@ponelat

Description

@ponelat
Contributor
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.

Activity

shockey

shockey commented on Nov 29, 2017

@shockey
Contributor

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

mmamyan commented on Jan 8, 2019

@mmamyan

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

mmamyan

mmamyan commented on Jan 15, 2019

@mmamyan

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

bbagno

bbagno commented on Jan 21, 2019

@bbagno

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

mmamyan

mmamyan commented on Jan 21, 2019

@mmamyan

@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

mmamyan commented on Jan 25, 2019

@mmamyan

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

shockey

shockey commented on Mar 6, 2019

@shockey
Contributor

FYI: this is still in my work queue!

19 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @webron@ahoehma@shockey@EduardSergeev@realjax

      Issue actions

        XML hints in the Model view show "OrderedMap" · Issue #3954 · swagger-api/swagger-ui