fix: add default None to optional command schema fields#24
Merged
alfonsosastre merged 1 commit intomainfrom Feb 26, 2026
Merged
fix: add default None to optional command schema fields#24alfonsosastre merged 1 commit intomainfrom
alfonsosastre merged 1 commit intomainfrom
Conversation
Per OCPI spec, fields like evse_uid, connector_id, and authorization_reference in StartSession and ReserveNow are optional (cardinality ?). Without `= None` default, Pydantic v2 requires them to be present in the request body even if null, causing 422 errors when callers correctly omit them. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
= Nonedefault to all optional (| None) fields inStartSession,ReserveNowcommand schemas across OCPI versions 2.1.1, 2.2.1, and 2.3.0X | Noneas "required but nullable", causing 422 validation errors when callers correctly omit optional fields per OCPI spec (cardinality?)START_SESSIONwithoutconnector_id, which is valid per spec but rejected by our schemaTest plan
connector_idand get a valid responseMade with Cursor