emicklei / go-restful-openapi

OpenAPI extension in Go for the go-restful package
MIT License
135 stars 73 forks source link

There are too many unnecessary things when integrating protobuf 3 #102

Open sea3366 opened 1 year ago

sea3366 commented 1 year ago

The Protobuf 3 structure will generate the following three fields: type User struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields }

These fields depend on other objects, and other objects depend on other objects.

Suggestion: Handle this special case in the buildProperty function. In fact, these fields do not need to generate documents.

File: definition_builder.go Function: buildProperty

emicklei commented 1 year ago

thank you for reporting this. I think only exported fields should be in the model. I will create a test for it and fix

On Wed, 21 Dec 2022 at 17:55, developer361 @.***> wrote:

The pb structure will generate the following three fields: type User struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields

....

}

These fields depend on other objects, and other objects depend on other objects.

Suggestion: Handle this special case in the buildProperty function. In fact, these fields do not need to generate documents.

File: definition_builder.go Function: buildProperty

— Reply to this email directly, view it on GitHub https://github.com/emicklei/go-restful-openapi/issues/102, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFHRDGITBNGNNKTVJH2YADWOMY7HANCNFSM6AAAAAATF2SLUA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Met vriendelijke groet, Kind regards,

Ernest Micklei

Try out my music project Melrōse https://melrōse.org