Skip to content

Fix: Inconsistent naming conventions in swagger yaml file #431

@lobsam

Description

@lobsam

Description

The openapi.yaml specification uses multiple different names for the same domain concepts across paths, schema names, parameter names, field names, and descriptions. This causes confusion when reading the spec, generating client SDKs, or writing integration tests. All references to a given concept must use one canonical name throughout.

The three main offenders are:

  • Edition / Manifestation / Instance — three names for the same resource
  • Text / Expression — two names for the same resource, including a path that mixes both
  • Several smaller field/parameter naming divergences

Tasks

  • Rename ManifestationEdition everywhere
    ManifestationOutput, ManifestationInput, ManifestationType schemas must be renamed to EditionOutput, EditionInput, EditionType. All manifestation_id fields in SegmentOutput, AlignmentOutput, AlignmentInput, and all inline descriptions ("ID of the manifestation…", "target manifestation", "List of related manifestations") must be updated to edition_id / "edition".

  • Rename InstanceEdition everywhere
    The GET /v2/texts/{text_id}/editions summary says "Get instances for text", the POST response says "Instance created successfully", and all six request body examples are named valid_diplomatic_instance_* / valid_critical_instance_*. Rename all to use "edition".

  • Rename ExpressionText everywhere
    ExpressionOutput, ExpressionInput, ExpressionPatch schemas must be renamed to TextOutput, TextInput, TextPatch. The path /v2/relations/expressions/{expression_id} must become /v2/relations/texts/{text_id}. The path /v2/texts/{expression_id}/tags/{tag_id} uses expression_id as its path parameter despite the path being under /v2/texts/ — that parameter must be renamed to text_id. All inline descriptions referencing "expression" or "expression ID" must be updated.

  • Standardize {note_id}{durchen_id}
    The durchen endpoint /v2/annotations/durchen/{note_id} is the only annotation endpoint that does not name its path parameter after the resource. All others use {segmentation_id}, {alignment_id}, {pagination_id}, {bibliographic_id}. Rename the parameter to {durchen_id}.

  • Standardize bibliography_annotationbibliographic_metadata
    The POST /v2/texts/{text_id}/editions request body uses the field name bibliography_annotation (and example keys valid_*_with_bibliography_annotation), while the POST /v2/editions/{edition_id}/annotations endpoint, AnnotationRequestInput, and AnnotationRequestOutput all use bibliographic_metadata. Rename the field and all example keys in the edition creation endpoint to bibliographic_metadata.

  • Fix schema name suffix inconsistencies
    Structural sub-schemas use two conflicting patterns: SpanModel, PageModel, VolumeModel have a *Model suffix, while AlignedSegment has none. Additionally, TextOperation is the only writable input schema that does not follow the *Input suffix used by SegmentationInput, AlignmentInput, PaginationInput, etc. Decide on one pattern and apply it consistently — either drop Model from the three suffixed schemas or add it to AlignedSegment, and rename TextOperation to TextOperationInput.

Reviewer

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Task.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions