diff --git a/docling_core/types/doc/base.py b/docling_core/types/doc/base.py index 8ded884..cd52ed1 100644 --- a/docling_core/types/doc/base.py +++ b/docling_core/types/doc/base.py @@ -6,7 +6,7 @@ """Define common models across CCS objects.""" from typing import Annotated, Literal, Optional, Union -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, Field, PositiveInt, StrictStr from docling_core.search.mapping import es_field from docling_core.utils.alias import AliasModel @@ -39,7 +39,7 @@ class S3Resource(BaseModel): mime: str path: str - page: Optional[int] = None + page: Optional[PositiveInt] = None class S3Data(AliasModel): @@ -68,7 +68,7 @@ class Prov(AliasModel): """Provenance.""" bbox: BoundingBox - page: int + page: PositiveInt span: Span ref_s3_data: Optional[StrictStr] = Field( default=None, alias="__ref_s3_data", json_schema_extra=es_field(suppress=True) @@ -96,7 +96,7 @@ class PageDimensions(BaseModel): """Page dimensions.""" height: float - page: int + page: PositiveInt width: float @@ -196,4 +196,4 @@ class PageReference(BaseModel): hash: str = Field(json_schema_extra=es_field(type="keyword", ignore_above=8191)) model: str = Field(json_schema_extra=es_field(suppress=True)) - page: int = Field(json_schema_extra=es_field(type="short")) + page: PositiveInt = Field(json_schema_extra=es_field(type="short")) diff --git a/docs/Document.json b/docs/Document.json index 7e6b3ce..828b4e8 100644 --- a/docs/Document.json +++ b/docs/Document.json @@ -1188,6 +1188,7 @@ "type": "number" }, "page": { + "exclusiveMinimum": 0, "title": "Page", "type": "integer" }, @@ -1219,6 +1220,7 @@ "x-es-suppress": true }, "page": { + "exclusiveMinimum": 0, "title": "Page", "type": "integer", "x-es-type": "short" @@ -1245,6 +1247,7 @@ "type": "array" }, "page": { + "exclusiveMinimum": 0, "title": "Page", "type": "integer" }, @@ -1547,6 +1550,7 @@ "page": { "anyOf": [ { + "exclusiveMinimum": 0, "type": "integer" }, { diff --git a/docs/Document.md b/docs/Document.md index 7860b4f..08c43b4 100644 --- a/docs/Document.md +++ b/docs/Document.md @@ -3598,6 +3598,10 @@ Must be one of: | **Type** | `integer` | | **Required** | Yes | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | + @@ -3995,6 +3999,10 @@ Must be one of: | **Type** | `integer` | | **Required** | Yes | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | + @@ -4404,6 +4412,10 @@ Must be one of: | **Type** | `integer` | | **Required** | Yes | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | + @@ -5732,6 +5744,10 @@ Must be one of: | **Type** | `integer` | | **Required** | Yes | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | + @@ -6149,6 +6165,10 @@ Must be one of: | **Type** | `integer` | | **Required** | Yes | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | + @@ -6540,6 +6560,10 @@ Must be one of: | **Type** | `integer` | | **Required** | Yes | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | + @@ -7020,6 +7044,10 @@ Must be one of: | **Type** | `integer` | | **Required** | Yes | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | + @@ -7228,6 +7256,10 @@ Must be one of: | **Type** | `integer` | | **Required** | Yes | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | + @@ -7557,6 +7589,10 @@ Must be one of: | **Type** | `integer` | | **Required** | Yes | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | + @@ -7971,6 +8007,10 @@ Must be one of: | **Type** | `integer` | | **Required** | Yes | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | + @@ -8248,6 +8288,10 @@ Must be one of: | **Type** | `integer` | | **Required** | No | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | +
@@ -8403,6 +8447,10 @@ Must be one of: | **Type** | `integer` | | **Required** | No | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | +
@@ -8558,6 +8606,10 @@ Must be one of: | **Type** | `integer` | | **Required** | No | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | +
@@ -8692,6 +8744,10 @@ Must be one of: | **Type** | `integer` | | **Required** | No | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | +
@@ -8826,6 +8882,10 @@ Must be one of: | **Type** | `integer` | | **Required** | No | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | +
@@ -8960,6 +9020,10 @@ Must be one of: | **Type** | `integer` | | **Required** | No | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | +
@@ -9115,6 +9179,10 @@ Must be one of: | **Type** | `integer` | | **Required** | No | +| Restrictions | | +| ------------ | ------ | +| **Minimum** | > 0 | +