epiphone / routing-controllers-openapi

Runtime OpenAPI v3 schema generation for routing-controllers.
MIT License
306 stars 58 forks source link

OpenAPI Description Decorator not Properly Escaped #68

Open mkamadeus opened 3 years ago

mkamadeus commented 3 years ago

As what the title says; description text is not properly escaped.

When I tried to give a description containing ' (single quote), the documentation stops completely, e.g:

@OpenAPI({
  description: "Get all student's LO",
  responses: {
    "200": {
      description: "OK",
    },
  },
})

When the single quote is removed, it works fine.

@OpenAPI({
  description: "Get all students LO",
  responses: {
    "200": {
      description: "OK",
    },
  },
})

A simple solution would be escaping the single quote with some regex or similar things.

mikeguta commented 3 years ago

I can't reproduce this issue @mkamadeus routing-controllers-openapi doesn't do the serialization, it just builds the OpenAPIObject which the consuming application can choose to serialize. What symptom did you encounter? I'm assuming some sort of tool failed to parse the output in your case. Do you remember what the tool was? Can you still reproduce the issue?

mkamadeus commented 3 years ago

@mikeguta Ah, I see. I used Redoc to display the documentation. I'll check again when I got the time to do so.