Skip to content

Conversation

@rlecellier
Copy link
Collaborator

@rlecellier rlecellier commented Nov 17, 2023

Purpose

Here the generated typescript client with the current joanie's openapi schema

TODO:

  • mv factory/joanie to factory/joanieLegacy, and joanieGen to joanie.

@rlecellier rlecellier force-pushed the rlecellier/generated_api_2023 branch 5 times, most recently from 29a7c08 to bb4c252 Compare November 21, 2023 11:08
Copy link
Collaborator Author

@rlecellier rlecellier left a comment

Choose a reason for hiding this comment

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

Quick comment on missing element of Addresses endoints

@rlecellier rlecellier force-pushed the rlecellier/generated_api_2023 branch from bb4c252 to 450cef9 Compare November 21, 2023 13:40
@rlecellier rlecellier force-pushed the rlecellier/generated_api_2023 branch from 450cef9 to 7c6fe4a Compare November 22, 2023 11:01

import type { Address } from './Address';

export type PaginatedAddressList = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@rlecellier rlecellier force-pushed the rlecellier/generated_api_2023 branch from 7c6fe4a to eecbfe5 Compare February 28, 2024 15:34
page?: number,
pageSize?: number,
productId?: string,
signatureState?: 'half_signed' | 'signed' | 'unsigned',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It would be nice to have :

enum SignatureStateEnum {
 half_signed,
 signed,
 unsigned
}
// ... 
signatureState?: SignatureStateEnum

@rlecellier rlecellier force-pushed the rlecellier/generated_api_2023 branch 6 times, most recently from a46fe84 to 1a38c6f Compare March 6, 2024 16:40
rlecellier and others added 3 commits March 7, 2024 15:30
We'll implement a api client generated from joanie's openApi schema.
The current client needs to change place.
We'll implement a api client generated from joanie's openApi schema.
The current client's type factories needs to change place.
Add [email protected] to the projet
this lib handle typescript api client generation from openapi schema
@rlecellier rlecellier force-pushed the rlecellier/generated_api_2023 branch 5 times, most recently from fcd2806 to 2d3a4c2 Compare March 7, 2024 15:56
rlecellier and others added 4 commits March 7, 2024 17:02
Generate typescript api client according to joanie openapi schema
on CoursesService and OrganizationService, a function get the id param
twice.
Generated api client need's to handle joanie authentification
use generated Address type instead of legacy one
@rlecellier rlecellier force-pushed the rlecellier/generated_api_2023 branch 2 times, most recently from 7125685 to 4781687 Compare March 7, 2024 16:17
@rlecellier rlecellier marked this pull request as ready for review March 7, 2024 16:20
@rlecellier rlecellier self-assigned this Mar 7, 2024
@rlecellier rlecellier requested review from NathanVss and jbpenrath and removed request for NathanVss March 7, 2024 16:20
now that we've generated types and api client, we need to use them into
our api hooks
@rlecellier rlecellier force-pushed the rlecellier/generated_api_2023 branch 2 times, most recently from 9efc67a to abefe25 Compare March 7, 2024 16:56
Joanie's api client shouldn't be loaded on test that don't use it.
@rlecellier rlecellier force-pushed the rlecellier/generated_api_2023 branch from abefe25 to 3da710e Compare March 8, 2024 08:37
@NathanVss NathanVss removed their request for review June 26, 2025 07:50
@jbpenrath jbpenrath requested review from Copilot and removed request for jbpenrath June 26, 2025 10:11
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the TypeScript API client generation and migrates all test and API references from the “joanie” naming to the “joanieLegacy” version, ensuring consistency with the current OpenAPI schema. Key changes include introducing a new local script for API client generation, updating package.json with a new generate script and dependency, and refactoring numerous test and component imports to use the legacy factories and API endpoints.

Reviewed Changes

Copilot reviewed 224 out of 225 changed files in this pull request and generated no comments.

File Description
generate_api_client_local.sh New bash script to generate the API client from the OpenAPI schema
package.json Added generate:api:client:local script and devDependency update
Multiple test and component files across the codebase Updated import paths from factories/joanie and types/Joanie to joanieLegacy and api/joanie/gen for legacy support
Comments suppressed due to low confidence (2)

src/frontend/js/utils/react-query/useSessionQuery/index.spec.tsx:47

  • Confirm that replacing checkStatus with checkStatusLegacy conforms to the new API client behavior and that all downstream code consuming this behavior has been updated accordingly.
        fetch('http://api.endpoint/orders/').then(checkStatusLegacy),

src/frontend/js/utils/test/factories/joanieLegacy.ts:163

  • Verify that updating the AddressFactory to use AddressGenFactory is intentional and that all address-related data now correctly originates from the new API client.
    address: AddressGenFactory().one(),

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.

2 participants