enhancemnt to "add_root" feature

Abierto
#781 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
ruby

Línea de trabajo

Start at the add_root feature entry point and inspect how it derives the root from the response model class; then check whether the response model exposes root_element(root_type) for collection_root and root. Done when generated Swagger output uses the entity-configured singular and plural roots while preserving existing behavior.

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

Descripción

The new add_root feature is extremely nice and something I've been waiting for in this gem for a while.

One small issue with it is that the way it handles dynamically building the 'root' name is solely based on the response model class name. Where as, ideally what would be nice is to "detect" if said response model is a grape-entity class and query the "Root" configuration from that class.

I have several GrapeEntity classes that change the "root" to be someone slightly different than the internal class name (e.g. OrganizationMember -> 'members'/'member') so having the swagger gem consult the entity class. (e.g. simply calling OrganizationMember.root_element(root_type) where root_type is :collection_root or :root ).

Lenguaje dominante
Ruby
Estrellas
1.1k
Forks
477
Merge medio
1 d 18 h
PR fusionados (30 d)
5

Preparar el entorno

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 ruby-grape/grape-swagger

Todos los issues de ruby-grape/grape-swagger

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.