quarkus-openapi-generator icon indicating copy to clipboard operation
quarkus-openapi-generator copied to clipboard

Server Code Generation drops Descriptions

Open VladDrakul1986 opened this issue 1 year ago • 1 comments

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);
}

VladDrakul1986 avatar Feb 11 '25 19:02 VladDrakul1986

I am taking this one.

mcruzdev avatar Feb 25 '25 14:02 mcruzdev

Closed by https://github.com/quarkiverse/quarkus-openapi-generator/pull/1015 (waiting new release)

mcruzdev avatar Mar 21 '25 15:03 mcruzdev