You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using abbreviations (in my case PDF) and x-go-name, non-compiled code is generated.
Example: a parameter named pdf_extraction_mode (translated to a literal PdfExtractionMode) and its x-go-name PDFExtractionMode.
The code in the *Params structure is generated correctly (the name is the same as in x-go-name), however, in the generated SetDefaults code, the PdfExtractionMode literal is substituted, which breaks the compilation.
$ go build ./client/
client/operations/extract_pdf_parameters.go:94:3: unknown field 'PdfExtractionMode' in struct literal of type ExtractPdfParams
Swagger specification
swagger: "2.0"info:
title: Sample APIdescription: API description in Markdown.version: 1.0.0host: api.example.combasePath: /v1schemes:
- httpspaths:
/pdf:
get:
operationId: ExtractPdfparameters:
- name: pdf_extraction_modetype: stringenum:
- fast
- fullx-go-name: PDFExtractionModedefault: fastdescription: Lorem ipsumin: formDataresponses:
200:
description: OK
Steps to reproduce
swagger generate client -q -A buggygen --spec example.yaml
trying to build this code (go build ./client)
Environment
swagger version: 0.30.3
go version: 1.19
OS: MacOS Catalina
The text was updated successfully, but these errors were encountered:
Problem statement
When using abbreviations (in my case PDF) and x-go-name, non-compiled code is generated.
Example: a parameter named pdf_extraction_mode (translated to a literal PdfExtractionMode) and its x-go-name PDFExtractionMode.
The code in the *Params structure is generated correctly (the name is the same as in x-go-name), however, in the generated SetDefaults code, the PdfExtractionMode literal is substituted, which breaks the compilation.
Swagger specification
Steps to reproduce
Environment
swagger version: 0.30.3
go version: 1.19
OS: MacOS Catalina
The text was updated successfully, but these errors were encountered: