OpenAPI/AsyncAPI detection matches `"openapi":`/`asyncapi:` keys inside JSON Schemas that describe OpenAPI documents, and redocly.yaml's theme section
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- Ein halber Tag
- Anfängerfreundlichkeit
- 65/100
Rechercherichtung
The detection regex is at project_validator/ecosystems/openapi.py line 50, and REDOCLY_SETTINGS is near line 170 of the same file. Start by reading how the OpenAPI profile chooses which files to scan, then run the repro from the issue (a JSON Schema with a nested openapi property, and a redocly.yaml with a top-level openapi: key). Done means both files are no longer treated as API descriptions, and real openapi.yaml files still pass.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
^\s{0,4}"(?:openapi|swagger)": matches a property key in SchemaStore's openapi-3.X.json, asyncapi's definitions/*/asyncapi.json and OAI's _archive_/schemas/v2.0/schema.json (JSON Schemas about OpenAPI), so schema repositories are judged as API-description projects and FAIL schema-declared ("5 OpenAPI files do not declare their version"); Redocly's redocly.yaml has a top-level openapi: theme section and FAILs "no info.version". An OpenAPI document has openapi: "3.x" as a string value (or swagger: "2.0") and info:; a schema has $schema/type/properties.
Evidence from the corpus audit
SchemaStore/schemastore, asyncapi/spec-json-schemas, OAI/OpenAPI-Specification / schema-declared (and detection)
- kind: FALSE_POSITIVE
- actual: FAIL:
OpenAPI/AsyncAPI: 5 OpenAPI files do not declare their version (openapi) and info.version
(SchemaStore);OpenAPI/AsyncAPI: 14 AsyncAPI files do not declare their version (asyncapi) and info.version
(spec-json-schemas);OpenAPI/AsyncAPI: 1 OpenAPI file does not declare its version … _archive_/schemas/v2.0/schema.json: no openapi(OAI) - expected: the files are JSON Schemas that describe OpenAPI/AsyncAPI documents (or a Kustomization), not
descriptions; they should not be found by the OpenAPI/AsyncAPI profile at all, and SchemaStore and
spec-json-schemas should not be "OpenAPI/AsyncAPI" projects (which also yields theirstatic-analysis,
schema-validation,schema-compatibilityandschema-examplesOpenAPI FAIL/WARN lines). - evidence:
project_validator/ecosystems/openapi.py:50:
OPENAPI: re.compile(r"^(?:openapi|swagger)\s*:|^\s{0,4}\"(?:openapi|swagger)\"\s*:", re.MULTILINE)matches a
property key indented by 4 spaces inside"properties"or"required".
SchemaStoresrc/schemas/json/openapi-3.X.json:2:"$schema": "https://json-schema.org/draft/2020-12/schema",
and:8:"openapi": {;src/schemas/json/grpc-api-gateway.json:9:"openapi": {;
src/test/kustomization/openapi.json:4:"openapi": {(a Kustomization).
spec-json-schemasdefinitions/1.0.0/asyncapi.json:3:"$schema": "http://json-schema.org/draft-04/schema#",
and:18:"asyncapi": {.
OAI_archive_/schemas/v2.0/schema.json:3:"$schema": "http://json-schema.org/draft-04/schema#",and:18:
"swagger": {. - repro: a file
openapi-schema.jsonwith{"$schema": "https://json-schema.org/draft/2020-12/schema", "properties": {\n "openapi": {"type": "string"}}}; the project is detected as OpenAPI and the file fails
schema-declaredwith "no openapi" and "no info.version". A fix is to require the key at the top level (parse the
head, or at most 2 spaces of indentation and not insideproperties), or to exclude files that are JSON Schemas. - confidence: high
Redocly/openapi-starter / schema-declared
- kind: FALSE_POSITIVE
- actual: FAIL:
1 OpenAPI file does not declare its version (openapi) and info.version/redocly.yaml: no info.version - expected: PASS:
redocly.yamlis the Redocly CLI configuration; its top-levelopenapi:key is Redocly's
documentation-theme section, not a specification version. The one real description,openapi/openapi.yaml,
declares both. - evidence:
redocly.yaml:1:# See https://redocly.com/docs/cli/configuration/ for more information.;
redocly.yaml:2-4:apis:/sample@v1:/root: openapi/openapi.yaml;redocly.yaml:11:openapi:;
openapi/openapi.yaml:1:openapi: 3.1.0,:7:version: 1.0.0. The same regex as above
(project_validator/ecosystems/openapi.py:50) matchesopenapi:at column 0 regardless of its value. - repro:
redocly.yamlwithapis: {a: {root: openapi.yaml}}\nopenapi:\n codeSamples: {}next to a valid
openapi.yaml. A fix is to exclude the known Redocly config names (REDOCLY_SETTINGSalready lists them,
openapi.py:170) and/or require the key's value to look like a version (openapi: 3.x,swagger: "2.0"). - confidence: high
Found by the regression-corpus audit (235 real repositories, one or more per ecosystem profile; corpus and expected results in corpus/). Evidence is quoted from the audited checkouts at the commits pinned in corpus/projects.toml; <checkouts>/<owner>__<repo> is such a checkout.
🤖 Generated with Claude Code
- Vorherrschende Sprache
- Python
- Sterne
- 4
- Forks
- 1
- Ø Merge
- 10 Std. 41 Min.
- Gemergte PRs (30 T.)
- 79
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus cpp-best-practices/project_validator
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
cpp-best-practices/project_validator#267 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
cpp-best-practices/project_validator#263 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
cpp-best-practices/project_validator#260 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
cpp-best-practices/project_validator#259 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
cpp-best-practices/project_validator#255 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in cpp-best-practices/project_validator
Ähnliche Issues
-
add entry to blockOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"Evtl. vergeben @0z5a hat das heute übernommen. Offenneeds-triage
Schwierigkeit 2/5 Ein halber Tag Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 2 Tagen
-
plot_graph crashes when a mesh node has no m2m edgeEvtl. vergeben @tygvi hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
mllam/neural-lam#883 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
future-agi/future-agi#4092 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
transcript analytics: a text whose only protected spans the prose pass redacts is withheld wholeOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
WingedGuardian/GENesis-AGI#4641 ·
Maintainer antworten meist innerhalb von 1 Tag