OpenAPI vocabulary or dialect for code generation
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- openapi
- Área
- api
Línea de trabajo
Comienza con el issue #2542 y revisa las restricciones de generación de código enumeradas y sus fundamentos. Determina si el proyecto quiere un vocabulario o dialecto OpenAPI compartido y, después, define un conjunto de reglas acordado y cómo debe codificarse. Se considera terminado cuando el alcance y la representación están resueltos, en lugar de quedar como una propuesta.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Code generation tools often have special requirements or restrictions on the structure of an OpenAPI definition (document?) that improve the generated code. Here are some examples of restrictions from the IBM OpenAPI SDK generator:
-
Parameters must be unique by name only, irrespective of "in".
Rationale: Operation parameters are often rendered as the parameters on a function or method in the target language of the code generator. Since most languages require parameters to have unique names, the code generator would need to incorporate the
inof a parameter into its name to prevent name collisions. This is undesirable, since it exposes the mechanics of the API without adding any value. -
There should be at most one success response with a response body. A 204 and other 2XX is okay, but no other combination of two or more 2XX responses.
Rationale: In statically-typed languages like Java, the return value of a method must have a single static type. This makes it difficult to represent an operation with two different response schemas as a single method returning a single response type.
-
Property names and parameter names must be "case-insensitive" unique
Rationale: Code generators often reformat the names of parameters, properties, and schemas to use idomatic case formatting for the target language: lower_snake_case for Python, lowerCamelCase for Java, etc. But this reformatting could introduce naming conflicts if two parameters, e.g. "foo_bar" and "fooBar" are not "case-insensitive" unique.
-
Arrays must contain items of a single type
Rationale: Many languages require an array to contain only values of a single type.
-
Schema type must specify a single type -- no type arrays
Rationale: Some widely-used statically-typed languages, e.g. Java and Go) have no provision for "union" types, making it impossible to define a
type: [ integer, string ]typed property or parameter. -
Don't use "nullable"
Rationale: it's deprecated, and is just an alternate way of expressing type arrays
-
Don't use JSON schema "not"
Rationale There's no obvious way to represent this in many widely used programming languages.
-
No "if-then-else" in JSON schema
Rationale There's no obvious way to represent this in many widely used programming languages.
-
The API document should be "self contained" (no external "$refs")
Rationale: External refs can easily create multiple namespaces for schemas, parameters, security schemes, etc. These are unnecessary complications for code generators.
-
All "$refs" must be to elements in the "components" section of the document
Rationale: "$ref" targets outside of "components" are unnecessary complications for code generators.
It would be nice to have a common set of rules like this that could be codified into a "Code generation" vocabulary or dialect for OpenAPI.
- Lenguaje dominante
- Markdown
- Estrellas
- 31.3k
- Forks
- 9.2k
- Merge medio
- 2 d 3 h
- PR fusionados (30 d)
- 8
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de OAI/OpenAPI-Specification
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
OAI/OpenAPI-Specification#5570 ·
Los mantenedores suelen responder en 1 día
-
Housekeeping
Dificultad 1/5 Menos de una hora Aptitud para principiantes 45/100
OAI/OpenAPI-Specification#5566 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
Housekeeping
Dificultad 1/5 Menos de una hora Aptitud para principiantes 35/100
OAI/OpenAPI-Specification#5562 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
Housekeeping
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
OAI/OpenAPI-Specification#5556 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
v3.2.1 releaseQuizá libre de nuevo @lornajane la tomó hace 35 días y no hay ningún pull request abierto. Abierto
OAI/OpenAPI-Specification#5460 · 11 comentarios · 1 reacción · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de OAI/OpenAPI-Specification
Issues similares
-
Path subtraction removes repeated suffix characters instead of one suffixPosiblemente ocupada @Gwerdonatus la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
joke2k/django-environ#671 ·
-
bug core p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
RunanywhereAI/runanywhere-sdks#1077 ·
Los mantenedores suelen responder en 5 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
juice-shop/juice-shop#3686 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
OpenTollGate/tollgate-module-basic-go#949 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
TurboDocx/html-to-docx#254 ·