swag icon indicating copy to clipboard operation
swag copied to clipboard

Refactor some things for the needs of github.com/go-chai/chai

Open e-nikolov opened this issue 3 years ago • 5 comments
trafficstars

Describe the PR

I am working on https://github.com/go-chai/chai - an extension for the chi router that provides support for type safe http handlers via generics. This allows it to also provide swagger spec generation that automatically detects the request/response types, http methods and route paths. Chai uses swaggo/swag annotations for the parts of the swagger spec that cannot be automatically inferred.

I am using swaggo/swag as a library but some of the functions that I needed were unexported and others I needed to modify a bit. I forked swag and made the changes I needed there, but I'd rather not have to maintain that fork and put the changes back into swag itself. This is the main place where I use swag.

I am opening this PR as a place for discussion for which parts can be merged into swag.

e-nikolov avatar Dec 31 '21 13:12 e-nikolov

@e-nikolov Thanks for contributing to this project. The idea of opening a pull request for your project requirements without discussing it on an issue it's very uninspired.

ubogdan avatar Jan 11 '22 22:01 ubogdan

I'm sorry if a PR wasn't your preference. I thought that making the proposed changes more visible would benefit the discussion. I'm not sure if it would be as easy to talk about each line in an issue.

e-nikolov avatar Jan 11 '22 23:01 e-nikolov

@e-nikolov I'm afraid these changes may introduce some breaking changes, and I can't take this responsibility.

ubogdan avatar Jan 20 '22 16:01 ubogdan

I understand not wanting to break backwards compatibility. Do you think it would be possible to export some of the functions? This way I could make an extension of swaggo/swag without having to fork it?

e-nikolov avatar Jan 20 '22 16:01 e-nikolov