[OpenAPI 3.1] Phase 1: 3.0→3.1 converter

Offen
#949 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 5 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
38/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
java, openapi
Bereich
tooling

Rechercherichtung

Start from the plan in #942, then look at how org.openapitools.openapidiff.core currently parses specs and where swagger-core's mapper and JsonSchema are already used. The new normalize package must walk components, parameters, headers, bodies, callbacks and nested schemas, applying the listed rules on a deep copy. Compare converted 3.0 output against natively parsed 3.1 for the paired fixtures under the test resources as serialized JSON; also add the Swagger 2.0 fixture and a test asserting the input objects are unchanged.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

OpenAPI 3.1.0 Support

Part of the OpenAPI 3.1 plan: #942 (Stage 1, Phase 1)

Goal

A converter that turns Swagger 2.0 / OpenAPI 3.0 objects into the 3.1 form. Not wired in yet.

Scope
  • New package org.openapitools.openapidiff.core.normalize, called once per spec
  • Walks every schema: components, parameters, headers, request/response bodies, callbacks, and nested (properties, items, additionalProperties, allOf/anyOf/oneOf, not)
  • Rules: type → types; nullable: true → "null" in types (not when there is no type); boolean exclusiveMinimum/Maximum → numeric; example → examples; typed classes → JsonSchema
  • Works on a copy (JSON round-trip with swagger-core's mapper), so the input objects are never modified
Done when
  • Converted 3.0 == natively parsed 3.1 (compared as serialized JSON) for all paired fixtures
  • Swagger 2.0 fixture converts correctly
  • Copy test: input objects are unchanged after conversion
Vorherrschende Sprache
Java
Sterne
1.1k
Forks
191
Ø Merge
4 T. 23 Std.
Gemergte PRs (30 T.)
1

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus OpenAPITools/openapi-diff

Alle Issues in OpenAPITools/openapi-diff

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.