Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[RFC] Handle OpenAPI 3.1 BC Breaks

Aperta
#130 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
openapi, php

Direzione di ricerca

Inizia leggendo i file di specifica OpenAPI 3.0 esistenti e le modifiche di pull request 128, quindi confrontali con le breaking changes elencate di OpenAPI 3.1 e le release notes collegate. Questo RFC sarà completato solo dopo che i maintainer avranno scelto e documentato un approccio per rappresentare 3.1 senza compromettere il supporto a 3.0 già completato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

openapi 3.1

It's nice to see the work for the OpenAPI 3.1 standard. I think a big part are the deprecated fields or type changes like:

  • The nullable keyword has been removed from the Schema Object (null can be used as a type value).
  • the type can be now an array with the type and null
  • exclusiveMaximum and exclusiveMinimum cannot accept boolean values (following JSON Schema).
  • See more at Stoplight Blog and OpenAPI Release Notes

How would you like to handle these breaking changes?
My first idea was to duplicate the spec files into a 3.0 and 3.1 Folder and use them according to the given OpenAPI version.
The positive parts are that static code analysis or the IDE knows which type of Object is used and the user don't have to handle multiple types. For example the type as string in OpenAPi 3.0 and type as array in OpenAPI 3.1 with null item. Also the spec could be validated and it's not necessary to add version switches for fields that are required or not.

The second Idea is to "convert" the Structure into the existing Spec Files. So a type with two items in OpenAPI would be an oneOf or if the type includes null the nullable flag would be added. But then you need to convert the items back to the new structure if you want to write a OpenAPI 3.1 file. The other part is, that you then support a converter from OpenAPI 3.0 to OpenAPI 3.1 and i don't think this is a feature to maintain in this library.

The last solution is to try to handle both versions into a single file. But that could be hard because of the breaking changes in OpenAPI 3.1. Even OpenAPI 3.1 didn't make a release without breaking changes. It could be complex to handle it here.

My preferred solution is version one because of the strict types and the clear break between Version 3.0 and 3.1
The Version and Specs for Version 3.0 are already feature complete and all changes effects only the new Spec files and couldn't break anything.

I look forward to your opinion. Maybe this should be clear before we make more changes into https://github.com/cebe/php-openapi/pull/128 ?

Lingua principale
PHP
Stelle
500
Fork
99
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cebe/php-openapi

Tutte le issue di cebe/php-openapi

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.