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

Use func SwgenDefinition if destination mapping type implements IDefinition interface. #12

Merged
merged 3 commits into from
May 22, 2017

Conversation

ngdinhtoan
Copy link
Contributor

No description provided.

@ngdinhtoan ngdinhtoan added this to the v0.2.0 milestone May 22, 2017
@coveralls
Copy link

coveralls commented May 22, 2017

Coverage Status

Coverage decreased (-0.5%) to 92.948% when pulling bf76725 on ngdinhtoan:typemapping into fb48f0a on lazada:master.

@vearutop
Copy link
Contributor

I tried it and it seems typeName from SwgenDefinition() is ignored.

Also how about we add a helper implementation of IDefinition:

type Definition struct {
	TypeName string
	swgen.SchemaObj
}

func (s Definition) SwgenDefinition() (typeName string, typeDef swgen.SchemaObj, err error) {
	typeName = s.TypeName
	typeDef = s.SchemaObj
	return
}

to use in AddTypeMap

g.AddTypeMap(nulltypes.NullTimestamp{}, Definition{TypeName: "MyName", SchemaObj: swgen.SchemaObj{Type: "integer", Format: "int64"}, })

@coveralls
Copy link

coveralls commented May 22, 2017

Coverage Status

Coverage decreased (-0.009%) to 93.41% when pulling ecf59be on ngdinhtoan:typemapping into fb48f0a on lazada:master.

@ngdinhtoan
Copy link
Contributor Author

@vearutop I have updated pull request.

@vearutop
Copy link
Contributor

All good for me.

@ngdinhtoan ngdinhtoan merged commit 7bd6308 into lazada:master May 22, 2017
@ngdinhtoan ngdinhtoan deleted the typemapping branch May 22, 2017 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants