Smart docs does not render regex properly.

8528-screen-shot-2019-04-29-at-22857-pm.png

8529-screen-shot-2019-04-29-at-23009-pm.png

I have a swagger 2.0 where I am using a "pattern" = "^.+@.+\..+$" field for an "email" property. When importing the spec on Dev Portal, it displays "^.+@.+\\..+$" which is not what I want.

0 6 106
6 REPLIES 6

@Dino-at-Google @Anil Sagar @ Google Please help me out here.

Also, required fields in the spec are not visible under schema section on Dev Portal smart docs.

It looks to me to be a difference between JSON and YAMNL encoding. In other words, it's the same information presented differently. Your expectations may need to be adjusted.

Aside from the display of the swagger, which looks to be correct to my eyes, are there any other symptoms?

@Dino-at-Google What kind of adjustments i need to do? Can you elaborate a little more? Other thing I noticed is no description for some fields in the API on smart docs but having description in spec file.

hey @Dino-at-Google Can you please help me out here?

I found out, when converting YAML to JSON, the JSON parser in Smartdocs module is adding a backslash(\) to escape an already present backslash(\) in the regex. so this seems to be default behavior of the JSON parser but in our case, this sort of behavior is messing up with our documentation