Skip to content

Components model: API: text file #2369

@DmitryAstafyev

Description

@DmitryAstafyev

The current version of the API requires explicitly providing information about the target parser and source (in the SessionSetup object).
However, there is a need for a simplified API intended for text files.

Possible implementation approaches

Adapting SessionSetup

Since, under the components model paradigm, the client has no knowledge of the available parsers and sources, one option is to modify the SessionSetup object so that the parser and source fields become optional.
If the client does not specify a target parser and source, rustcore would interpret this as a command to treat the file as a plain text file.

Introducing a "known" parser and source

Another approach is to define a specific UUID for a parser and source pair dedicated to processing text files.
On the client side, this UUID could be hardcoded (which is not recommended), or a dedicated API could be introduced to return the UUIDs for the text parser and source, allowing the client to retrieve and reuse them as needed.

The first option (adapting the SessionSetup object) appears to be the most appropriate.
However, this would require rustcore to define behavior for cases where the provided file is not a text file - which would likely result in an error.

Metadata

Metadata

Labels

components modelComponents model is a major refactoring aimed at fully isolating the core logic from the client.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions