Exemple #1
0
func (suite *ModelSuite) SetupSuite() {
	if initialisedParser == nil {
		initialisedParser = parser.NewParser()
		initialisedParser.ParseTypeDefinitions(ExamplePackageName)
	}
	suite.parser = initialisedParser
	suite.knownModelNames = make(map[string]bool)
}
Exemple #2
0
func InitParser(controllerClass string) *parser.Parser {
	parser := parser.NewParser()

	parser.BasePath = "{{.}}"
	parser.ControllerClass = controllerClass
	parser.IsController = IsController

	parser.TypesImplementingMarshalInterface["NullString"] = "string"
	parser.TypesImplementingMarshalInterface["NullInt64"] = "int"
	parser.TypesImplementingMarshalInterface["NullFloat64"] = "float"
	parser.TypesImplementingMarshalInterface["NullBool"] = "bool"

	return parser
}
Exemple #3
0
func (suite *ParserSuite) SetupSuite() {
	if initialisedParser2 == nil {
		initialisedParser2 = parser.NewParser()

		initialisedParser2.BasePath = exampleBasePath
		initialisedParser2.IsController = IsController

		gopath := os.Getenv("GOPATH")
		if gopath == "" {
			suite.T().Fatalf("Please, set $GOPATH environment variable\n")
		}

		initialisedParser2.ParseGeneralApiInfo(path.Join(gopath, "src", "github.com/yvasiyarov/swagger/example/web/main.go"))
		initialisedParser2.ParseApi("github.com/yvasiyarov/swagger/example")
	}
	suite.parser = initialisedParser2
}
func (suite *ApiDeclarationSuite) SetupSuite() {
	suite.parser = parser.NewParser()
	suite.operation = parser.NewOperation(suite.parser, "test")
	suite.operation2 = parser.NewOperation(suite.parser, "test")
	suite.operation3 = parser.NewOperation(suite.parser, "test")
}
Exemple #5
0
func (suite *OperationSuite) SetupSuite() {
	suite.parser = parser.NewParser()
}