Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I18N-1323 - Update Mojito CLI to use OpenAPI spec for rest calls #240

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DarKhaos
Copy link

@DarKhaos DarKhaos commented Feb 1, 2025

Generate code from open API specification and reuse the generated models and clients

@DarKhaos DarKhaos force-pushed the I18N-1323_P3 branch 3 times, most recently from 72265a9 to 5f8b939 Compare February 1, 2025 16:05
</dependency>

<dependency>
<groupId>com.box.l10n.mojito</groupId>
<artifactId>mojito-restclient</artifactId>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed restclient dependency

import org.springframework.web.client.HttpClientErrorException;

@Component
public class HttpClientErrorExceptionHelper {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved classes from restclient module to cli module

@@ -0,0 +1,7 @@
package com.box.l10n.mojito.cli.apiclient.exception;

public class AssetNotFoundException extends ResourceNotFoundException {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved exception classes from restclient module to cli module

import org.springframework.web.util.UriComponentsBuilder;

@Component
public class AuthenticatedRestTemplate {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved authentication classes from restclient module to cli module

@DarKhaos DarKhaos marked this pull request as ready for review February 3, 2025 14:49
@DarKhaos DarKhaos requested a review from a team as a code owner February 3, 2025 14:49
Generate code from open API specification and reuse the generated models and clients

/** */
public class PseudoLocCommandTest extends CLITestBase {

/** logger */
static Logger logger = LoggerFactory.getLogger(PseudoLocCommandTest.class);

@Autowired RepositoryClient repositoryClient;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not need a replacement? Was it unused previously?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it was unused

@@ -30,12 +28,8 @@ public class PerformanceSanboxTest extends CLITestBase {

static int NUMBER_OF_TEXTUNITS = 10000;

@Autowired RepositoryClient repositoryClient;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No replacement needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it was unused

@Autowired RepositoryRepository repositoryRepository;

@Autowired AssetClient assetClient;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No replacement needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it was unused

@@ -65,8 +64,6 @@ public class CLITestBase extends IOTestBase {

@Autowired ResttemplateConfig resttemplateConfig;

@Autowired RepositoryClient repositoryClient;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No replacement needed here?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it was unused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants