oto icon indicating copy to clipboard operation
oto copied to clipboard

fix parse type: field must be exported

Open touchmarine opened this issue 1 year ago • 0 comments

Parsing the below example fails with the error: parse output object type: parse type: /usr/local/go/src/math/big/int.go:34:2: neg must be exported.

type CalculatorService interface {
	Calculate(CalculateRequest) CalculateResponse
}

type CalculateRequest struct{}

type CalculateResponse struct {
	// big.Int has unexported fields
	Result big.Int
}

This pull request fixes this, but still errors if the request or response object has an unexported field:

type CalculatorService interface {
	Calculate(CalculateRequest) CalculateResponse
}

type CalculateRequest struct{}

type CalculateResponse struct {
	result int
}

touchmarine avatar Jan 18 '24 15:01 touchmarine