Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowing customs description, group API tags, example data,... #81

Open
Anhdao153 opened this issue Aug 20, 2024 · 1 comment
Open

Allowing customs description, group API tags, example data,... #81

Anhdao153 opened this issue Aug 20, 2024 · 1 comment

Comments

@Anhdao153
Copy link

Feature Request

I'm trying to setup a new project. I worked with nestJS, they allow me write description of APIs, group API tags, example data body,... Currently there are some hard if i wanna write description for a API (how to use it)

Maybe at a controller function. we are able to init a new struct

apiDescription := apiDetail{
   description: "",
   ....
}

with routes, are there some problem if we automatic add them to APIs Tags which have already a group ?

Screenshot 2024-08-20 at 09 27 42
@TommoLeedsy
Copy link
Contributor

Hi @Anhdao153,

Thanks for using astra!
To add a description to an API route you just need to add a comment above the handler:

// This is a test handler
testHandler(c *gin.Context) {
    c.JSON(http.StatusOK, gin.H{"message": "hello world"))
}

Examples values and tagged API groups are on our backlog but we would defiantly review a PR if you wanted to contribute?

Hope that all helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants