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

Server Code Generation drops Descriptions #985

Open
VladDrakul1986 opened this issue Feb 11, 2025 · 0 comments
Open

Server Code Generation drops Descriptions #985

VladDrakul1986 opened this issue Feb 11, 2025 · 0 comments
Assignees
Labels
area:server This item is related to the server extension

Comments

@VladDrakul1986
Copy link

I tried to generate the Resources for my open api file.
Unfortunately the descriptions are only included in the javadoc.
I would prefer to have this information in @operation(summary = "", description = "") to have this in the generated swagger again.
Is there any chance to do this?
Example Result with the infamous petshop example ;)

package io.petstore;

import io.petstore.beans.ApiResponse;
import io.petstore.beans.Pet;
import jakarta.validation.constraints.NotNull;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.DELETE;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.HeaderParam;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.PUT;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import java.io.InputStream;
import java.util.List;

/**
 * A JAX-RS interface. An implementation of this interface must be provided.
 */
@Path("/pet")
public interface PetResource {
  /**
   * 
   */
  @Path("/{petId}/uploadImage")
  @POST
  @Produces("application/json")
  @Consumes("multipart/form-data")
  ApiResponse uploadFile(@PathParam("petId") long petId, @NotNull InputStream data);

  /**
   * 
   */
  @PUT
  @Consumes({"application/xml", "application/json"})
  void updatePet(@NotNull Pet data);

  /**
   * 
   */
  @POST
  @Consumes({"application/xml", "application/json"})
  void addPet(@NotNull Pet data);

  /**
   * <p>
   * Multiple status values can be provided with comma separated strings
   * </p>
   * 
   */
  @Path("/findByStatus")
  @GET
  @Produces({"application/xml", "application/json"})

  List<Pet> findPetsByStatus(@QueryParam("status") @NotNull List<String> status);

  /**
   * <p>
   * Multiple tags can be provided with comma separated strings. Use tag1, tag2,
   * tag3 for testing.
   * </p>
   * 
   */
  @Path("/findByTags")
  @GET
  @Produces({"application/xml", "application/json"})
  List<Pet> findPetsByTags(@QueryParam("tags") @NotNull List<String> tags);

  /**
   * <p>
   * Returns a single pet
   * </p>
   * 
   */
  @Path("/{petId}")
  @GET
  @Produces({"application/xml", "application/json"})
  Pet getPetById(@PathParam("petId") long petId);

  /**
   * 
   */
  @Path("/{petId}")
  @POST
  @Consumes("application/x-www-form-urlencoded")
  void updatePetWithForm(@PathParam("petId") long petId, @NotNull InputStream data);

  /**
   * 
   */
  @Path("/{petId}")
  @DELETE
  void deletePet(@HeaderParam("api_key") String apiKey, @PathParam("petId") long petId);
}
@ricardozanini ricardozanini added the area:server This item is related to the server extension label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:server This item is related to the server extension
Projects
None yet
Development

No branches or pull requests

3 participants