Skip to content

Prevent kitgen from failing on interface-type #745

Closed
@ermik

Description

Here's an example of a service definition that fails in kitgen:

package profilesvc

import "context"

type Service interface {
	PostProfile(ctx context.Context, p Profile) error
}

type Profile struct {
	ID        string                 `json:"id"`
	Name      string                 `json:"name,omitempty"`
        // fails because of loosely typed field with interface{}
	Neighbors map[string]interface{} `json:"neighbors,omitempty"`
}

type Address struct {
	ID       string `json:"id"`
	Location string `json:"location,omitempty"`
}

Error message:
examining input file "./in.go": found 7 interfaces, expecting exactly 1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions