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

[Feature Request] Swift Support

Aperta
#71 3 commenti 12 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à
Attiva
Stack tecnologico
swift

Direzione di ricerca

Inizia esaminando le implementazioni esistenti di protovalidate e i riferimenti a SwiftProtobuf, connect-swift e gRPC-Swift indicati nell’issue. Definisci l’ambito per i binding Swift, la validazione a runtime, la compatibilità e un interprete CEL prima di identificare i punti di ingresso per l’implementazione e i test. Il lavoro sarà completato quando l’ambito sarà concordato, sarà disponibile un supporto funzionante per la validazione Swift e saranno presenti i test e la documentazione corrispondenti.

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

Descrizione

Language Support

Feature description:
Extend the capabilities of the protovalidate library to include support for performing runtime validation of Protocol Buffers messages in Swift projects.

Problem it solves or use case:
The current lack of Swift support in the protovalidate library poses challenges for developers who work with Protocol Buffers and Swift. By introducing Swift support, developers can validate Protocol Buffers messages at runtime within their Swift applications, enhancing data integrity and reducing potential issues related to data validation.

Proposed implementation or solution:
The proposed solution involves extending the existing protovalidate library to incorporate Swift bindings and compatibility. This includes defining Swift structures or classes that mirror Protocol Buffers message structures, and implementing runtime validation functions that align with Swift's strong typing.

Challenges with Enforcing Validation on the Swift Client:
Enforcing validation on the Swift client could introduce challenges due to the widespread impact of validation changes. Swift's strong typing and compile-time safety would necessitate strict adherence to validation rules. However, making validation changes would lead to breaking changes on both the client and server sides. Any update to validation rules could result in inconsistencies between the client and server if they're not synced properly. This would require maintaining compatibility across different versions of the Protocol Buffers definitions, which could become a complex and error-prone task.

Importance of a CEL Interpreter for Advanced Validation:
To address these challenges, an integral part of the solution would involve creating a CEL (Common Expression Language) interpreter for Swift. CEL allows for the specification of complex validation rules in an expressive and language-agnostic manner. This interpreter would be instrumental in enabling advanced validation expressions that can be used within the protovalidate library. Given that a CEL interpreter for Swift is not currently under development an effort would need to be undertaken to create this

Contribution:
I am enthusiastic about contributing to this feature by participating in discussions, assisting in defining Swift type structures, collaborating on the implementation of runtime validation functions for Swift, and potentially contributing to the development of the CEL interpreter for Swift. I am also willing to help with writing tests and documentation to ensure comprehensive coverage and guidance.

Examples or references:
While protovalidate does not currently offer Swift support, libraries like connect-swift, SwiftProtobuf and gRPC-Swift can provide insights into integrating Protocol Buffers messages into Swift projects.

Additional context:
Adding Swift support to the protovalidate library will cater to developers who use Protocol Buffers in Swift applications, allowing them to perform runtime validation without the need for external code generation. The creation of a CEL interpreter for Swift would further enhance the validation capabilities of the library, enabling advanced validation expressions to be used seamlessly across languages.

Lingua principale
Go
Stelle
1.6k
Fork
67
Merge medio
1g 10h
PR unite (30g)
4

Preparare l'ambiente

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 bufbuild/protovalidate

Tutte le issue di bufbuild/protovalidate

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.