-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Problem statement
The client generator has begun generated invalid code, pretty much out of the blue, and I can't figure out what's going on. It generates a client file that imports stuff that it doesn't need and also does not import the operations package, creating an error.
The reason why I say this is out of the blue is because I've only just begun experiencing this error. I managed to generate a working client before with v0.27.0, with the same specs. For about a week now the client generator no longer works.
Swagger specification
{
"host": "secure.na1.adobesign.com",
"basePath": "/api/rest/v6",
"schemes": [
"https"
],
"swagger": "2.0",
"info": {
"title": "transientDocuments",
"version": "6.0.0"
},
"paths": {
"/transientDocuments": {
"post": {
"produces": [
"application/json"
],
"operationId": "createTransientDocument",
"summary": "Uploads a document and obtains the document's ID.",
"description": "The document uploaded through this call is referred to as transient since it is available only for 7 days after the upload. The returned transient document ID can be used in the API calls where the uploaded file needs to be referred. The transient document request is a multipart request consisting of three parts - filename, mime type and the file stream. You can only upload one file at a time in this request.",
"consumes": [
"multipart/form-data"
],
"parameters": [
{
"in": "header",
"description": "An <a href=\"#\" onclick=\"this.href=oauthDoc()\" oncontextmenu=\"this.href=oauthDoc()\" target=\"oauthDoc\">OAuth Access Token</a> with any of the following scopes:<ul><li style='list-style-type: square'><a href=\"#\" onclick=\"this.href=oauthDoc('agreement_write')\" oncontextmenu=\"this.href=oauthDoc('agreement_write')\" target=\"oauthDoc\">agreement_write</a></li><li style='list-style-type: square'><a href=\"#\" onclick=\"this.href=oauthDoc('agreement_sign')\" oncontextmenu=\"this.href=oauthDoc('agreement_sign')\" target=\"oauthDoc\">agreement_sign</a></li><li style='list-style-type: square'><a href=\"#\" onclick=\"this.href=oauthDoc('widget_write')\" oncontextmenu=\"this.href=oauthDoc('widget_write')\" target=\"oauthDoc\">widget_write</a></li><li style='list-style-type: square'><a href=\"#\" onclick=\"this.href=oauthDoc('library_write')\" oncontextmenu=\"this.href=oauthDoc('library_write')\" target=\"oauthDoc\">library_write</a></li></ul>in the format <b>'Bearer {accessToken}'.",
"name": "Authorization",
"required": true,
"type": "string"
},
{
"in": "header",
"description": "The userId or email of API caller using the account or group token in the format <b>userid:{userId} OR email:{email}.</b> If it is not specified, then the caller is inferred from the token.",
"name": "x-api-user",
"required": false,
"type": "string"
},
{
"in": "header",
"description": "The userId or email in the format <b>userid:{userId} OR email:{email}.</b> of the user that has shared his/her account",
"name": "x-on-behalf-of-user",
"required": false,
"type": "string"
},
{
"in": "formData",
"description": "A name for the document being uploaded. Maximum number of characters in the name is restricted to 255.",
"name": "File-Name",
"required": false,
"type": "string"
},
{
"in": "formData",
"description": "The mime type of the document being uploaded. If not specified here then mime type is picked up from the file object. If mime type is not present there either then mime type is inferred from file name extension.",
"name": "Mime-Type",
"required": false,
"type": "string"
},
{
"in": "formData",
"description": "The file part of the multipart request for document upload. You can upload only one file at a time.",
"name": "File",
"required": true,
"type": "file"
}
],
"responses": {
"200": {
"description": "No response was specified",
"schema": {
"$ref": "#/definitions/TransientDocumentResponse"
}
}
},
"security": [
{
"oauth2": [
"agreement_write",
"agreement_sign",
"widget_write",
"library_write"
]
}
]
}
}
},
"definitions": {
"TransientDocumentResponse": {
"required": [
"transientDocumentId"
],
"properties": {
"transientDocumentId": {
"type": "string",
"description": "The unique identifier of the uploaded document that can be used in an agreement or a bulk send or web form creation call"
}
}
}
}
}
Steps to reproduce
I run use the docker image to generate the client, the command looks like docker run --rm -it --user 1000:1000 -v /home/simon:/home/simon -w /home/simon/projects/nestoca/adobe-sign/swagger quay.io/goswagger/swagger:v0.27.0 generate client -f /home/simon/projects/nestoca/adobe-sign/swagger/2.0/transientDocuments.json -t /home/simon/projects/nestoca/adobe-sign/swagger/pkg/transientDocuments
Environment
swagger version: v0.27.0 , v0.26.1
go version: 1.16.5
OS: Debian 10 amd64