Add support for OpenAPI spec 3.2

Abierto
#3,324 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 9 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
java, openapi, spring-boot
Área
api, backend

Línea de trabajo

Start by reading how springdoc generates api-docs and handles OpenAPI specification versions, then compare its current 3.1 support with the requested 3.2 behavior. Done means springdoc can generate api-docs using version 3.2.x and represent the XML element with attributes and text content as described.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement upstream

Is your feature request related to a problem? Please describe.

My problem is that I want to describe an XML schema and generate examples that have an element with attributes and a text-type child element:

<request>
  <signature version="2.0">123abc</signature>
</request>

The result when translating the DAO with JAXB

@Schema
@XmlRootElement(name = "request")
public class Request {
  @XmlElement(name = "signature")
  public Signature signature;

  public class Signature {
    @Schema(example = "2.0")
    @XmlElement(name = "version")
    public String version;

    @Schema(example = "123abc")
    @XmlValue
    public String value;
}

but rendering it with springdoc 2.8.17 and OpenAPI 3.1 gives me the api-docs:

<request>
  <signature version="2.0">
    <value>123abc</value>
  </signature>
</request>

Describe the solution you'd like
The lack of support for this stems from OpenAPI not supporting this as of spec 3.1. There was an issue filed for OpenAPI-Specification https://github.com/OAI/OpenAPI-Specification/issues/630. It was implemented in https://github.com/OAI/OpenAPI-Specification/pull/4592 and released in https://github.com/OAI/OpenAPI-Specification/releases/tag/3.2.0.

So I'd like springdoc to add support for api-docs version 3.2.x.

Describe alternatives you've considered
My alternative for now is to hard-code the example into my api-docs and accept the wrong looking schema until newer OpenAPI spec versions.

Lenguaje dominante
Java
Estrellas
3.7k
Forks
605
Merge medio
9 d 11 h
PR fusionados (30 d)
14

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de springdoc/springdoc-openapi

Todos los issues de springdoc/springdoc-openapi

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.