Skip to content

Commit

Permalink
Merge pull request #690 from piyumaldk/main
Browse files Browse the repository at this point in the history
  • Loading branch information
lasanthaS authored Apr 19, 2024
2 parents 0136227 + d46b4b5 commit 567ff73
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 27 deletions.
6 changes: 0 additions & 6 deletions portals/publisher/src/main/webapp/site/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -6669,12 +6669,6 @@
"value": "Name/Content Type"
}
],
"Apis.Details.Resources.components.operationComponents.ListParameter.parameter.spec.error": [
{
"type": 0,
"value": "Error in resolving the definition!"
}
],
"Apis.Details.Resources.components.operationComponents.ListParameter.parameter.type": [
{
"type": 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3183,9 +3183,6 @@
"Apis.Details.Resources.components.operationComponents.ListParameter.parameter.name": {
"defaultMessage": "Name/Content Type"
},
"Apis.Details.Resources.components.operationComponents.ListParameter.parameter.spec.error": {
"defaultMessage": "Error in resolving the definition!"
},
"Apis.Details.Resources.components.operationComponents.ListParameter.parameter.type": {
"defaultMessage": "Parameter Type"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import Banner from 'AppComponents/Shared/Banner';
import API from 'AppData/api';
import CircularProgress from '@mui/material/CircularProgress';
import PropTypes from 'prop-types';
import SwaggerParser from '@apidevtools/swagger-parser';
import SwaggerClient from 'swagger-client';
import { isRestricted } from 'AppData/AuthManager';
import CONSTS from 'AppData/Constants';
import Configurations from 'Config';
Expand Down Expand Up @@ -363,18 +363,15 @@ export default function Resources(props) {
/*
* Used SwaggerParser.validate() because we can get the errors as well.
*/
SwaggerParser.validate(specCopy, (err, result) => {
setResolvedSpec(() => {
const errors = err ? [err] : [];
return {
spec: result,
errors,
};
SwaggerClient.resolve({ spec: specCopy })
.then(specR => {
setResolvedSpec(specR);
})
.finally(() => {
operationsDispatcher({ action: 'init', data: rawSpec.paths });
setOpenAPISpec(rawSpec);
setSecurityDefScopesFromSpec(rawSpec);
});
});
operationsDispatcher({ action: 'init', data: rawSpec.paths });
setOpenAPISpec(rawSpec);
setSecurityDefScopesFromSpec(rawSpec);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,7 @@ export default function ListParameters(props) {
disableActions
dense
type='error'
message={(
<FormattedMessage
id='Apis.Details.Resources.components.operationComponents.ListParameter.parameter.spec.error'
defaultMessage='Error in resolving the definition!'
/>
)}
message='Error in resolving the definition!'
/>
);
}
Expand Down

0 comments on commit 567ff73

Please sign in to comment.