Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.0.1 dataclasses have a incorrect types that don't match carnality #340

Closed
T-amairi opened this issue Jun 21, 2022 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@T-amairi
Copy link

Based on the OCPP spec (page 379), IdTokenType should have an optional list for additional_info attribute (see the cardinality of additionalInfo in the spec : 0..*).

  • Current version (0..1) :
@dataclass
class IdTokenType:
    """
    Contains a case insensitive identifier to use for the authorization and the
    type of authorization to support multiple forms of identifiers.
    IdTokenType is used by: AuthorizationData, Common:IdTokenInfoType,
    RequestStartTransactionRequest, AuthorizeRequest, TransactionEventRequest,
    ReserveNowRequest, CustomerInformationRequest
    """

    id_token: str
    type: enums.IdTokenType
    additional_info: Optional[AdditionalInfoType] = None
  • Correct version (0..*) ? :
@dataclass
class IdTokenType:
    """
    Contains a case insensitive identifier to use for the authorization and the
    type of authorization to support multiple forms of identifiers.
    IdTokenType is used by: AuthorizationData, Common:IdTokenInfoType,
    RequestStartTransactionRequest, AuthorizeRequest, TransactionEventRequest,
    ReserveNowRequest, CustomerInformationRequest
    """

    id_token: str
    type: enums.IdTokenType
    additional_info: Optional[List[AdditionalInfoType]] = None
@Jared-Newell-Mobility Jared-Newell-Mobility added the bug Something isn't working label Sep 11, 2023
@Jared-Newell-Mobility
Copy link
Collaborator

Jared-Newell-Mobility commented Sep 11, 2023

Thank-you for raising this; so from the schema snippet below additional_info is defined as being an array, however, there appears to be inconsistency with type declarations in other places also - I'll change this to a bug.

"IdTokenType": {
	  "description": "Contains a case insensitive identifier to use for the authorization and the type of authorization to support multiple forms of identifiers.\r\n",
	  "javaType": "IdToken",
	  "type": "object",
	  "additionalProperties": false,
	  "properties": {
		"customData": {
		  "$ref": "#/definitions/CustomDataType"
		},
		"additionalInfo": {
		  "type": "array",
		  "additionalItems": false,
		  "items": {
			"$ref": "#/definitions/AdditionalInfoType"
		  },
		  "minItems": 1
		},
		"idToken": {
		  "description": "IdToken is case insensitive. Might hold the hidden id of an RFID tag, but can for example also contain a UUID.\r\n",
		  "type": "string",
		  "maxLength": 36
		},
		"type": {
		  "$ref": "#/definitions/IdTokenEnumType"
		}
	  },
	  "required": [
		"idToken",
		"type"
	  ]
	},

@Jared-Newell-Mobility Jared-Newell-Mobility changed the title Wrong dataclass IdTokenType (v201) 2.0.1 dataclass have a incorrect types that don't match carnality Nov 13, 2023
@Jared-Newell-Mobility Jared-Newell-Mobility changed the title 2.0.1 dataclass have a incorrect types that don't match carnality 2.0.1 dataclasses have a incorrect types that don't match carnality Nov 13, 2023
@Jared-Newell-Mobility
Copy link
Collaborator

PR approved in #529 will be included in v1.0.0

Jared-Newell-Mobility added a commit that referenced this issue Feb 14, 2024
## 1.0.0-rc.1 (2024-02-14)

- [#573](#573) Introduce
Experimental Module For v2.1
- [#547](#547) Feat: Handle
recursively serializing a dataclasses as a dictionary Thanks
[@MacDue](https://github.com/MacDue)
- [#601](#601) Fix case
conversion for soc in non "State of Charge" context
- [#523](#523) The
serialisation of soc to SoC should not occur in camel case if it is
existing at the beginning of a field
- [#515](#515) Update
Readthedocs configuration
- [#602](#602) Correct v2g
serialisation/deserialisation
- [#557](#557) OCPP 2.0.1
Wrong data type in CostUpdated total_cost
- [#564](#564) Add support
For Python 3.11 and 3.12
- [#583](#583) OCPP
v1.6/v2.0.1 deprecate dataclasses from calls and call results with the
suffix 'Payload'
- [#590](#336)
snake_to_camel_case url to URL does not get converted correctly
- [#591](#591)
Camel_to_snake_case doesn't handle v2x correctly
- [#593](#593) Update tests
to use Call and CallResult without the suffix Payload
- [#435](#435) Typo in
CostUpdated Action
- [#577](#577) v2.0.1
AttributeType Enum Corrections
- [#340](#340) 2.0.1
dataclasses have a incorrect types that don't match carnality
- [#519](#519) Typo in
v201.enums.StatusInfoReasonType.invaild_schedule
- [#510](#510) v2.0.1
UnitOfMeasureType - Enums missing and update docstring to allow use for
variableCharacteristics
- [#508](#508) Exception -
OccurrenceConstraintViolationError doc string correction

## DEPRECATED ##
- [#599](#599) v1.6 Action
Enum members corrected IMPORTANT SEE UPGRADE PATH
[#599](#599)
- [#579](#579) v2.0.1 Action
enums corrected - IMPORTANT SEE UPGRADE PATH
[#579](#579)

## BREAKING ##
- [#574](#574) Remove v1.6
deprecated enum members - IMPORTANT see upgrade path
[#574](#574)
- [#498](#498) Remove
support for OCPP 2.0 - IMPORTANT SEE UPGRADE PATH
[#498](#498)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants