const applyAdditionalOptions = () => {
const newValues = GITHUB_ADDITIONAL_FIELDS.map((settingKey) => values[settingKey]);
saveSettings(newValues);
- if (newGithubProvisioningStatus ?? githubProvisioningStatus) {
- if (rolesMapping) {
- updateMapping(rolesMapping)
- .then(() => {
- setRolesMapping(null);
- })
- .catch(() => {});
- }
+ if ((newGithubProvisioningStatus ?? githubProvisioningStatus) && rolesMapping) {
+ updateMapping(rolesMapping)
+ .then(() => {
+ setRolesMapping(null);
+ })
+ .catch(() => {});
}
};
export default function ApiResponseSchema(props: Props) {
const { content, ...other } = props;
- if (!content || !content['application/json']?.schema) {
+ const schema =
+ content &&
+ (content['application/json']?.schema || content['application/merge-patch+json']?.schema);
+ if (!schema) {
return <TextMuted text={translate('no_data')} />;
}
<CodeSnippet
language="json"
className="sw-p-6"
- snippet={JSON.stringify(mapOpenAPISchema(content['application/json'].schema), null, 2)}
+ snippet={JSON.stringify(mapOpenAPISchema(schema), null, 2)}
wrap
{...other}
/>
import { OpenAPIV3 } from 'openapi-types';
import { DereferenceRecursive, ExcludeReferences } from './types';
-export const URL_DIVIDER = '-';
+export const URL_DIVIDER = '--';
type ConvertedSchema = string | { [Key: string]: ConvertedSchema } | ConvertedSchema[];