Skip to content

Inconsistency in the models.py #19

@MehmedGIT

Description

@MehmedGIT

The ProcessorRsrc model in models.py is extending the BaseModel it should rather extend Resource.

Resource(BaseModel)
ProcessorRsrc(BaseModel)
WorkspaceRsrc(Resource)
WorkflowRsrc(Resource)

From the openapi.yml spec:

Resource:
  type: object
  required: ['@id']
  properties:
    '@id':
      type: string
      description: URL of this thing
    description:
      type: string
      description: Description of the thing
Workspace:
  allOf:
    - {$ref: '#/components/schemas/Resource'}
Workflow:
  allOf:
    - {$ref: '#/components/schemas/Resource'}
Processor:
  description: The ocrd-tool.json for a specific tool
  x-$ref: 'https://ocr-d.de/ocrd_tool.schema.json#/properties/tools/patternProperties/ocrd-.*'

Since the Processor model does not have field id we cannot directly extend the Resource model.

I suggest the following correction in the openapi.yml spec:

Processor:
  id: ocrd-.*
  description: The ocrd-tool.json for a specific tool
  x-$ref: 'https://ocr-d.de/ocrd_tool.schema.json#/properties/tools/patternProperties/ocrd-.*'

Then this will be possible:

Resource(BaseModel)
ProcessorRsrc(Resource)
WorkspaceRsrc(Resource)
WorkflowRsrc(Resource)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions