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

Keep $ref dereference when writing the update files

Aperta
#71 4 commenti 2 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
javascript
Ambito
api, tooling

Direzione di ricerca

Start by reviewing openapi-format's current dereference, formatting, and file-writing flow, then read the linked json-refs example for resolveRefs and updateRefs. Done should mean formatted OpenAPI documents preserve their $ref values and propagate changes back to the referenced files.

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

Descrizione

enhancement new feature

Currently, openapi-format dereferences the OpenAPI documents to do its formatting, sorting, ... and write a dereferenced result.

Investigate the option to leverage: https://www.npmjs.com/package/json-refs to format the OpenAPI documents and update the $ref values in different files.

const jsonRefs = require('json-refs');

const json = {
  "foo": {
    "$ref": "#/bar"
  },
  "bar": {
    "baz": "qux"
  }
};

const options = {
  filter: ['relative', 'remote'],
  loaderOptions: {
    processContent: (res, callback) => callback(undefined, res.text)
  }
};

jsonRefs.resolveRefs(json, options).then(
  (results) => {
    // make changes to the resolved object
    results.resolved.bar.baz = "newValue";
    // write the changes to the $ref locations
    jsonRefs.updateRefs(results.refs, results.resolved).then(
      (updated) => console.log(updated),
      (err) => console.log(err)
    );
  },
  (err) => console.log(err)
);
Lingua principale
JavaScript
Stelle
177
Fork
30
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

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 thim81/openapi-format

Tutte le issue di thim81/openapi-format

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.