JSONAPI-Resources / JSONAPI-Resources/jsonapi-resources

Feature Request: Give an error hint if wrong attribute case is used

Offen
#1,278 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Type: Enhancement
Vorherrschende Sprache
Ruby
Sterne
2.3k
Forks
546
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

This issue is a (choose one):

  • Problem/bug report.
  • Feature request.
  • Request for support. Note: Please try to avoid submitting issues for support requests. Use Gitter instead.

Checklist before submitting:

  • I've searched for an existing issue.
  • I've asked my question on Gitter and have not received a satisfactory answer.
  • I've included a complete bug report template. This step helps us and allows us to see the bug without trying to reproduce the problem from your description. It helps you because you will frequently detect if it's a problem specific to your project.
  • The feature I'm asking for is compliant with the JSON:API spec.

Description

Choose one section below and delete the other:

Features:

If I set my attribute casing to be say camelCased, but the request comes in with attributes that are snake_cased or kebab-cased, when we throw a "param not allowed" can we instead check if the cases just mismatch and instead throw an error indicating that you may have been using the wrong case. This is something that happens occasionally especially with new engineers getting on a project, but would instantly save a bunch of frustration here and there when these bugs happen.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die Verarbeitung eines "param not allowed"-Fehlers und die Konfiguration für die Schreibweise von Attributen zu lokalisieren. Prüfe, wie camelCased-, snake_cased- und kebab-cased-Attribute verarbeitet werden, und verifiziere anschließend, dass eine nicht übereinstimmende Schreibweise einen hilfreichen Hinweis erzeugt, ohne das gültige JSON:API-Verhalten zu ändern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rails, ruby
Bereich
api, backend
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

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