microsoft / microsoft/OpenAPI.NET.OData
Provide a way to not generate navigation paths with key
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C#
- Estrellas
- 239
- Forks
- 70
- Merge medio
- 7 h 59 min
- PR fusionados (30 d)
- 13
Descripción
I am new to implementing my first OData service. I am using OData for .NET 8+ with the ODataConventionModelBuilder to generate my model.
When a navigation property references an entity that is indexable, a path is generated of the form
Entity({ID})/NavEntity({ID1}) or Entity/{ID}/NavEntity/{ID1}.
The routing conventions don't include this path. They only support navigation to the NavEntity level. It would be helpful if there were a way to configure the conversion not to generate navigation paths with the key, even though the entity has one. As a practical matter, I'm not sure when I would need to query the navigation property by key, especially if the navigation property is available as a root entity.
As a workaround, I have added code to remove the unsupported paths from the OpenApiDocument before serializing it. As the OData service evolves, this code has to also evolve. If the conversion didn't generate the path with multiple keys, this workaround code would be unnecessary.
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.
Línea de trabajo
Rastrea la conversión de ODataConventionModelBuilder a través de la generación de OpenApiDocument y las convenciones de enrutamiento. Identifica dónde se agregan las rutas de navegación con clave y, a continuación, determina cómo la configuración podría suprimirlas y verifica que los documentos generados omitan esas rutas no compatibles sin eliminar las rutas de navegación válidas.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- csharp
- Área
- api, backend-api-design
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100