Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Missing functions to remove elements ?

Offen
#153 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

@Aribros arbeitet bereits daran.

Seit 08.9.2023.

  • #194 von @Aribros — offen

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
25/100
Issue-Typ
Feature
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
php
Bereich
api

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

enhancement

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

  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 cebe/php-openapi

Alle Issues in cebe/php-openapi

Ähnliche Issues

Weitere Issues zu PHP

Neue Issues direkt in Ihr Postfach

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