Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ressource id type array leads to invalid generated code #1314

Closed
generikvault opened this issue Dec 7, 2017 · 1 comment · Fixed by #1447
Closed

ressource id type array leads to invalid generated code #1314

generikvault opened this issue Dec 7, 2017 · 1 comment · Fixed by #1447
Assignees
Labels
bug generator needs testing Needs more testing for issue confirmation/qualification

Comments

@generikvault
Copy link

Problem statement

Using an array type as ressource id leads to invalid generated code.

func ({{ .ReceiverName }} *{{ pascalize .Name }}URL) Build() (*url.URL, error)
in
\templates\server\urlbuilder.gotmpl

expects that {{ varname .ID }} is a string, but {{ .Formatter }} does not work for arrays.

Please remove the sections that don't apply

Swagger specification

paths:
/resource/{resource}/{IDs}:
get:
...

parameters:
IDs:
name: IDs
in: path
description: A singele object ID or a comma seperated list of objects IDs.
type: array
items:
type: string
collectionFormat: csv
minItems: 1
uniqueItems: true
required: true

Steps to reproduce

generate go code with an array type as ressource id

Environment

swagger version: commit/278bee9f9204f7941f11df84fe6f09dded3bdb19
go version: 1.9
OS: any

@fredbi fredbi added the needs testing Needs more testing for issue confirmation/qualification label Feb 18, 2018
@fredbi
Copy link
Contributor

fredbi commented Feb 18, 2018

Should be fixed with PR #1394.
To be tested again.

@fredbi fredbi self-assigned this Feb 18, 2018
@fredbi fredbi added bug and removed enhancement labels Mar 6, 2018
fredbi added a commit to fredbi/go-swagger that referenced this issue Mar 9, 2018
* fixes go-swagger#866 - acknowledge flatten works fine

* fixes go-swagger#946 - acknowledge JSON marshal and validation

* fixes go-swagger#1314 - add fixture to CI codegen testing

* fixes go-swagger#1013 - acknowledge fixed

* fixes go-swagger#1062 - added fixture to CI codegen test

* fixes go-swagger#1237 - acknowledge validation in body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug generator needs testing Needs more testing for issue confirmation/qualification
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants