Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions examples/generate/serverurls/gen.go

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ this is a regression

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pkg/codegen/templates/server-urls.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{{ range . }}
{{ if eq 0 (len .OAPISchema.Variables) }}
{{/* URLs without variables are straightforward, so we'll create them a constant */}}
// {{ .GoName }} defines the Server URL for {{ .OAPISchema.Description }}
const {{ .GoName}} = "{{ .OAPISchema.URL }}"
// {{ .GoName }} defines the Server URL for {{ if len .OAPISchema.Description }}{{ .OAPISchema.Description }}{{ else }}{{ .OAPISchema.URL }}{{ end }}
{{ else }}
{{/* URLs with variables are not straightforward, as we may need multiple types, and so will model them as a function */}}

Expand Down