Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Ordering of matches when no path is concrete

Abierto
#2,356 7 comentarios 6 reacciones 0 asignados Ver en GitHub

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
Documentación
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
openapi

Línea de trabajo

Comienza con la sección «Patterned Fields» enlazada de OpenAPI 3.0.3 y con la discusión en OpenAPI Specification issue #1459. Compara sus indicaciones con el ejemplo de templated path de este issue y determina si existe una regla normativa de ordenación. Se considera completado cuando la ambigüedad queda resuelta mediante una regla documentada o una declaración clara de que la especificación no define ninguna.

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

Descripción

clarification request matching

I'm a contributor for an OpenAPI Validator project, and one of our users has raised an issue that their the spec is not matching in the order they would expect (you can see the issue here).

The issue effectively boils down to the user expecting a path with just one templated segment to be matched over a path with more than one templated segment, i.e.:

/{id1}/{id2}/{id3}
/resource/{id}/new <- Expect this one to be picked

With a request path like: /resource/1/new.

Currently we are matching simply based on the order of the paths as defined by the user in their specification file (which is probably not the correct approach). My question is whether it is specified anywhere how to resolve/match multiple templated matches?

Looking at the relevant part of the OpenAPI3 spec, while it discusses preferring a concrete path over a path which uses templates, from the spec I couldn't see how paths would be chosen if both match the request, and both use templates in the path. Since the examples in the spec are fairly short, I wasn't sure if the above example would fall into the ambiguous category or not.

I did manage to find a discussion in your issues here which hints at the fact most people would match a path with more concrete segments, over one with less. Since we are a validation tool, I would prefer to be able to apply concrete rules.

Do you have any advice/further reading on matching paths like the above example?

Lenguaje dominante
Markdown
Estrellas
31.2k
Forks
9.2k
Merge medio
2 d 9 h
PR fusionados (30 d)
17

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 OAI/OpenAPI-Specification

Todos los issues de OAI/OpenAPI-Specification

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.