Skip to content

Commit

Permalink
Merge pull request #723 from nevermined-io/fix/openapi_optional
Browse files Browse the repository at this point in the history
fix: adding openapi endpoint when there is one
  • Loading branch information
aaitor authored Oct 10, 2024
2 parents d6aa1aa + 20ad9e8 commit 6b091f9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nevermined-io/sdk",
"version": "3.0.39",
"version": "3.0.40",
"description": "Javascript SDK for connecting with Nevermined Data Platform ",
"main": "./dist/node/sdk.js",
"typings": "./dist/node/sdk.d.ts",
Expand Down
16 changes: 10 additions & 6 deletions src/nevermined/api/RegistryBaseApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,16 @@ export abstract class RegistryBaseApi extends Instantiable {
ddo.id,
)

assetAttributes.metadata.additionalInformation = {
...assetAttributes.metadata.additionalInformation,
customData: {
openApi: assetAttributes.metadata.main.webService?.openEndpoints[0],
},
}
if (
assetAttributes.metadata.main.webService?.openEndpoints &&
assetAttributes.metadata.main.webService?.openEndpoints.length > 0
)
assetAttributes.metadata.additionalInformation = {
...assetAttributes.metadata.additionalInformation,
customData: {
openApi: assetAttributes.metadata.main.webService?.openEndpoints[0],
},
}

const encryptedServiceAttributesResponse = await this.nevermined.services.node.encrypt(
ddo.id,
Expand Down

0 comments on commit 6b091f9

Please sign in to comment.