Skip to content

Integration with viper #2572

@robotoer

Description

@robotoer

Problem statement

Hi go-swagger team! We're trying to use go-swagger with viper to write a command line tool and api server but we can't figure out how to pass custom data (such as a viper object) into a generated go-swagger server. Ideally we would be able to pass additional custom parameters into the configureAPI function. Is there some other mechanism for threading data through to configureAPI(...) from the program's main entry point?

More specifically we want to be able to use the result of calling:

someCustomConfig := &config.MyConfig{}
myViperInstance.Unmarshal(someCustomConfig)

inside of configureAPI where myViperInstance must be constructed in our main.

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