sillsdev / sillsdev/serval

Remove deprecated non-parallel corpus from Serval

Open
#635 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
3
Forks
2
Avg merge
3d 1h
Merged PRs (30d)
3

Description

This change would constitute a major breaking change. This work would be a continuation of https://github.com/sillsdev/serval/pull/497 and https://github.com/sillsdev/serval/pull/535.

When we do this, we should also properly address the DTO naming collision issue across translation and word alignment. (From Damien's comment here) This impacts AlignedWordPairDto, ParallelCorpusFilterConfigDto, ParallelCorpusFilterDto, TrainingCorpusConfigDto, and TrainingCorpusDto. The name collisions happen in the Swagger JSON file as well. This means that we need to make a breaking change to get this right. We have two options:

  • Prefix all DTO names with "Translation" or "WordAlignment". This was what I originally was trying to do, but clearly failed, since I allowed some DTO names without the prefix. We can do this automatically using the ServalSchemaNameGenerator. We could remove the prefix from DTOs that already have the prefix, i.e. TranslationEngineDto could be renamed to EngineDto.
  • Add custom hooks in NSwag to generate DTOs in "Serval.Client" with different namespaces. For example, Serval.Translation.AlignedWordPairDto would be generated in the client as Serval.Translation.AlignedWordPair instead of Serval.Client.AlignedWordPair. The translation engines client interface would be generated as Serval.Translation.ITranslationEnginesClient. I don't think NSwag supports this out-of-the-box. We would need to create our own console application that calls NSwag. See [this](https://github.com/RicoSuter/NSwag/issues/2728 for more information).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked pull requests, the ServalSchemaNameGenerator, and the DTOs named in the issue, then investigate how NSwag produces the Swagger JSON and Serval.Client types. Compare the two proposed naming approaches; done means the deprecated non-parallel corpus is removed and the translation and word-alignment DTO names no longer collide.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.