Make ‘var’ attribute of a Field optional

Looking at [the spec](https://xmpp.org/extensions/xep-0004.html#protocol-field)
it seems valid not to have a `var` attribute set, at least for fields of type
`fixed` that is:

> If the element type is anything other than "fixed" (see below), it MUST
> possess a 'var' attribute that uniquely identifies the field in the context
> of the form (if it is "fixed", it MAY possess a 'var' attribute). The element
> MAY possess a 'label' attribute that defines a human-readable name for the field.
This commit is contained in:
mb 2023-08-30 15:55:18 +02:00
commit ac0707e52d
No known key found for this signature in database
7 changed files with 71 additions and 24 deletions

View file

@ -229,7 +229,7 @@ mod tests {
title: None,
instructions: None,
fields: vec![Field {
var: String::from("pubsub#access_model"),
var: Some(String::from("pubsub#access_model")),
type_: FieldType::ListSingle,
label: None,
required: false,
@ -276,7 +276,7 @@ mod tests {
title: None,
instructions: None,
fields: vec![Field {
var: String::from("pubsub#access_model"),
var: Some(String::from("pubsub#access_model")),
type_: FieldType::ListSingle,
label: None,
required: false,