8000 configure_xxx.go file gets overwritten everytime. · Issue #687 · go-swagger/go-swagger · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
configure_xxx.go file gets overwritten everytime. #687
Closed
@anisimovsergey

Description

@anisimovsergey

Problem statement

Even though there is a message in such file saying
// This file is safe to edit. Once it exists it will not be overwritten
the file gets always rewritten by calling swagger generate server...

Swagger specification

any

Steps to reproduce

  1. Execute 'swagger generate server -f swagger.json'
  2. Modify the file generated which starts with 'configure_' and sits in restapi folder
  3. Execute 'swagger generate server -f swagger.json' again

It seems like the problem is in ToFileName function from github.com\go-openapi\swag\util.go
I extended the test for this function with case: {"FileWithExtension.go", "file_with_extension.go"}

And it failed with this message:

--- FAIL: TestToFileName (0.01s)
        Error Trace:    util_test.go:133
        Error:          Not equal:
                        expected: "file_with_extension.go"
                        received: "file_with_extension_go"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0