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

Missing functions to remove elements ?

Aperta
#153 1 commento 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
php
Ambito
api

Direzione di ricerca

Inizia con gli esempi esistenti paths->removePath('/path') e operation-unset, quindi esamina come sono rappresentati Components::$schemas, x-Webhooks e tags. Riproduci la notifica relativa alla proprietà sovraccaricata e determina come può essere rimosso ciascun elemento; il lavoro è completato quando schemas, webhooks e tags possono essere rimossi senza errori.

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

Descrizione

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

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.