func oasType(f *gen.Field) (*spec.Type, error) {
	if f.IsEnum() {
		return _string, nil
	}

	s := f.Type.String()
	if strings.Contains(s, "[]") {
		ending := strings.Replace(s, "[]", "", 1)
		t, ok := oasTypes[ending]
		if !ok {
			return nil, fmt.Errorf("no OAS-type exists for %q", s)
		}
		return &spec.Type{
			Type:   "array",
			Format: t.Format,
			Items:  t,
		}, nil
	}
	t, ok := oasTypes[s]
	if !ok {
		return nil, fmt.Errorf("no OAS-type exists for %q", s)
	}
	return t, nil
}
// oasType returns the spec.Type to use for the given field.
oasType returns the spec.Type to use for the given field.
// oasType returns the spec . Type to use for the given field .
func oasType(f *gen.Field) (*spec.Type, error) {
	if f.IsEnum() {
		return _string, nil
	}
	s := f.Type.String()
	if strings.Contains(s, "[]") {
		ending := strings.Replace(s, "[]", "", 1)
		t, ok := oasTypes[ending]
		if !ok {
			return nil, fmt.Errorf("no OAS-type exists for %q", s)
		}
		return &spec.Type{
			Type:   "array",
			Format: t.Format,
			Items:  t,
		}, nil
	}
	t, ok := oasTypes[s]
	if !ok {
		return nil, fmt.Errorf("no OAS-type exists for %q", s)
	}
	return t, nil
}
func oasType ( f * gen . Field ) ( * spec . Type , error ) { if f . IsEnum ( ) { return _string , nil } s := f . Type . String ( ) if strings . Contains ( s , " " ) { ending := strings . Replace ( s , " " , " " , 1 ) t , ok := oasTypes [ ending ] if ! ok { return nil , fmt . Errorf ( " " , s ) } return & spec . Type { Type : " " , Format : t . Format , Items : t , } , nil } t , ok := oasTypes [ s ] if ! ok { return nil , fmt . Errorf ( " " , s ) } return t , nil }
oasType returns the spec.Type to use for the given field.
oasType returns the spec . Type to use for the given field .