Missing functions to remove elements ?
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
Rechercherichtung
Beginne mit den vorhandenen Beispielen paths->removePath('/path') und operation-unset und untersuche anschließend, wie Components::$schemas, x-Webhooks und tags dargestellt werden. Reproduziere den Hinweis auf eine überladene Eigenschaft und ermittle, wie jedes Element entfernt werden kann; als abgeschlossen gilt die Aufgabe, wenn schemas, webhooks und tags ohne Fehler entfernt werden können.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Hi,
I've been working on a project that would allow to take a full OAS Definition file and create a stripped down version using only a subset of the original endpoints, tags, webhooks, etc.
I want to remove internal functions based on a "x-internal" attributes.
I also want to create different versions of an api definition based on a "x-presentations" attributes.
So Far, I was able to remove uneeded:
- "paths" using paths->removePath('/path')
- "operations" using unset(pathItem->post)
But now I am struggling to find a way to remove other types of elements.
For example:
- Trying to remove a schema using
unset($openapi->components->schemas['foo']);
Give an error: "PHP Notice: Indirect modification of overloaded property cebe\openapi\spec\Components::$schemas has no effect" - Trying to delete an element from x-Webhooks gives the same kind of error
- Tags doesn't seem to be possible at all since Tag Item are added to an unindexed array...
I am considering forking the project and starting to work on fixes for that but before I do I'd like to know:
1- If I'm doing something wrong and it's already possible to remove object. If so, I would appreciate a pointer.
2- If it's not possible, would you consider to improve the library to include the new functionality ? Or are you considering this as irrelevant to the project ? I'd be willing to help if you do.
If we can find a way to remove elements, I would also implement a function to remove unused elements automatically using a recursive referencing counter algorithm detecting unused elements.
Thanks in advance
- Vorherrschende Sprache
- PHP
- Sterne
- 501
- Forks
- 99
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Kein Beitragsleitfaden
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 cebe/php-openapi
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
cebe/php-openapi#250 ·
-
BC break in 1.8Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
cebe/php-openapi#247 · 1 Kommentar · 1 Reaktion ·
-
php 8.4 deprecationsOffen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 58/100
cebe/php-openapi#245 · 3 Kommentare ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 52/100
cebe/php-openapi#242 · 6 Kommentare · 1 Reaktion ·
-
Add support for empty Security Requirement Object (`{}`) in security requirementEvtl. vergeben @SOHELAHMED7 hat das vor 515 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 55/100
cebe/php-openapi#238 ·
Alle Issues in cebe/php-openapi
Ähnliche Issues
-
sync-en
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
sync-en
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 4 Tagen
-
Combination form: image thumbnails collapse to 0×0 when a stylesheet sets `img { max-width: 100% }`Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
PrestaShop/PrestaShop#43200 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Type] Enhancement Help Wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
codeigniter4/CodeIgniter4#10616 ·
Maintainer antworten meist innerhalb von 1 Tag