Skip to content

Commit

Permalink
fix(gen): Escape backticks during the flags generation (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
clemfromspace authored Oct 3, 2023
1 parent d634fc7 commit ba62f0c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/gen/gen_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,9 @@ func getFlag(param *openapi3.Schema) *SpecFlag {

// getDescription returns the description for the given parameter.
func getDescription(param *openapi3.Schema) string {
// Escape backticks
param.Description = strings.ReplaceAll(param.Description, "`", "`+\"`\"+`")

if param.Enum != nil {
choices := make([]string, len(param.Enum))
for i, e := range param.Enum {
Expand Down

0 comments on commit ba62f0c

Please sign in to comment.