# Fields

Any **field** can be defined as independent element inside the **\<fields>** child of the [\<schema>](https://alex-robenko.gitbook.io/commsdsl-specification/schema_def) or a [namespace](https://alex-robenko.gitbook.io/commsdsl-specification/namespaces).

```
<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
    <fields>
        <int name="SomeField" type="uint8" />
        ...
    </fields>
</schema>
```

It can also be defined as a member of a message.

```
<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
    <message name="SomeMessage" id="1">
        <int name="SomeField" type="uint8" />
        ...
    </message>
</schema>
```

Field that is defined as a child of **\<fields>** node of the [\<schema>](https://alex-robenko.gitbook.io/commsdsl-specification/schema_def) or [\<ns>](https://alex-robenko.gitbook.io/commsdsl-specification/namespaces) can be referenced by other fields to avoid duplication of the same definition.

```
<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
    <ns name="ns1">
        <int name="SomeField" type="uint8" />
        <ref name="AliasToField" field="ns1.SomeField" />
    </ns>
    <message name="SomeMessage" id="1">
        <ref name="Mem1" field="ns1.SomeField"" />
        ...
    </message>
</schema>
```

The available fields are described in details in the sections to follow. They are:

* [\<enum>](https://alex-robenko.gitbook.io/commsdsl-specification/fields/enum) - Enumeration field.
* [\<int>](https://alex-robenko.gitbook.io/commsdsl-specification/fields/int) - Integral value field.
* [\<set>](https://alex-robenko.gitbook.io/commsdsl-specification/fields/set) - Bitset (bitmask) field.
* [\<bitfield>](https://alex-robenko.gitbook.io/commsdsl-specification/fields/bitfield) - Bitfield field.
* [\<bundle>](https://alex-robenko.gitbook.io/commsdsl-specification/fields/bundle) - Bundle field.
* [\<string>](https://alex-robenko.gitbook.io/commsdsl-specification/fields/string) - String field.
* [\<data>](https://alex-robenko.gitbook.io/commsdsl-specification/fields/data) - Raw data field.
* [\<list>](https://alex-robenko.gitbook.io/commsdsl-specification/fields/list) - List of other fields.
* [\<float>](https://alex-robenko.gitbook.io/commsdsl-specification/fields/float) - Floating point value field.
* [\<ref>](https://alex-robenko.gitbook.io/commsdsl-specification/fields/ref) - Reference to (alias of) other field.
* [\<optional>](https://alex-robenko.gitbook.io/commsdsl-specification/fields/optional)- Optional field.
* [\<variant>](https://alex-robenko.gitbook.io/commsdsl-specification/fields/variant)- Variant field.

All this fields have [common](https://alex-robenko.gitbook.io/commsdsl-specification/fields/common) as well as their own specific set of properties.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://alex-robenko.gitbook.io/commsdsl-specification/fields.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
