Skip to content

Commit 2a450ad

Browse files
authored
fix: resolved ApiParam inconsistencies and corrected TypeScript-Angular generator name in openapi-generator (#1426)
1 parent 24d58a1 commit 2a450ad

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

.github/workflows/release-and-publish-sdk.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ jobs:
131131
- start-backend-export-swagger
132132
strategy:
133133
matrix:
134-
generator: [python, python-pydantic-v1, typescript]
134+
generator: [python, python-pydantic-v1, typescript-angular]
135135

136136
steps:
137137
- name: Checkout repository
@@ -152,7 +152,7 @@ jobs:
152152
--git-repo-id scicat-backend-next \
153153
--git-user-id SciCatProject \
154154
-o ./sdk/${{ matrix.generator }} $(
155-
if [ "${{ matrix.generator }}" == "typescript" ]; then
155+
if [ "${{ matrix.generator }}" == "typescript-angular" ]; then
156156
echo "--additional-properties=npmVersion=${{ needs.build-release.outputs.new_tag}}";
157157
elif [ "${{ matrix.generator }}" == "python" ]; then
158158
echo "--additional-properties=packageVersion=${{ needs.build-release.outputs.new_tag}}";
@@ -183,18 +183,18 @@ jobs:
183183
node-version: ${{ env.NODE_VERSION }}
184184
registry-url: "https://registry.npmjs.org/"
185185

186-
- name: Download TypeScript SDK Artifact
186+
- name: Download TypeScript Angular SDK Artifact
187187
uses: actions/download-artifact@v4
188188
with:
189-
name: sdk-typescript-${{github.sha}}
189+
name: sdk-typescript-angular-${{github.sha}}
190190
path: ./sdk
191191

192192
- name: Publish package
193193
run: |
194194
npm install
195195
npm run build
196196
npm publish --access public
197-
working-directory: ./sdk/typescript/
197+
working-directory: ./sdk/typescript-angular/
198198
env:
199199
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
200200

.github/workflows/upload-sdk-artifact.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- start-backend-and-upload-swagger-schema
4949
strategy:
5050
matrix:
51-
generator: [python, typescript, python-pydantic-v1]
51+
generator: [python, typescript-angular, python-pydantic-v1]
5252

5353
steps:
5454
- name: Checkout repository
@@ -67,7 +67,7 @@ jobs:
6767
config-file: .github/openapi/${{ matrix.generator }}-config.json
6868
command-args: |
6969
-o ./sdk/${{ matrix.generator }} $(
70-
if [ "${{ matrix.generator }}" == "typescript" ]; then
70+
if [ "${{ matrix.generator }}" == "typescript-angular" ]; then
7171
echo "--additional-properties=npmVersion=${{env.SDK_VERSION}}";
7272
elif [ "${{ matrix.generator }}" == "python" ]; then
7373
echo "--additional-properties=packageVersion=${{env.SDK_VERSION}}";

src/samples/samples.controller.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ export class SamplesController {
566566
"Returns a boolean indicating whether the user has access to the sample with the specified ID.",
567567
})
568568
@ApiParam({
569-
name: "pid",
569+
name: "id",
570570
description: "ID of the sample to check access for",
571571
type: String,
572572
})
@@ -774,17 +774,17 @@ export class SamplesController {
774774
})
775775
async findOneAttachment(
776776
@Req() request: Request,
777-
@Param("id") sampleId: string,
777+
@Param("id") id: string,
778778
@Param("fk") attachmentId: string,
779779
): Promise<Attachment | null> {
780780
await this.checkPermissionsForSample(
781781
request,
782-
sampleId,
782+
id,
783783
Action.SampleAttachmentRead,
784784
);
785785
return this.attachmentsService.findOne({
786786
id: attachmentId,
787-
sampleId: sampleId,
787+
sampleId: id,
788788
});
789789
}
790790

@@ -816,17 +816,17 @@ export class SamplesController {
816816
})
817817
async findOneAttachmentAndRemove(
818818
@Req() request: Request,
819-
@Param("id") sampleId: string,
819+
@Param("id") id: string,
820820
@Param("fk") attachmentId: string,
821821
): Promise<unknown> {
822822
await this.checkPermissionsForSample(
823823
request,
824-
sampleId,
824+
id,
825825
Action.SampleAttachmentDelete,
826826
);
827827
return this.attachmentsService.findOneAndDelete({
828828
_id: attachmentId,
829-
sampleId: sampleId,
829+
sampleId: id,
830830
});
831831
}
832832

@@ -867,7 +867,7 @@ export class SamplesController {
867867
})
868868
async findAllDatasets(
869869
@Req() request: Request,
870-
@Param("id") sampleId: string,
870+
@Param("id") id: string,
871871
): Promise<DatasetClass[] | null> {
872872
const user: JWTUser = request.user as JWTUser;
873873
const ability = this.caslAbilityFactory.samplesInstanceAccess(user);
@@ -900,7 +900,7 @@ export class SamplesController {
900900
}
901901

902902
const dataset = await this.datasetsService.fullquery({
903-
where: { sampleId },
903+
where: { sampleId: id },
904904
fields: fields,
905905
});
906906
return dataset;

0 commit comments

Comments
 (0)