Skip to content

Commit

Permalink
Merge pull request #979 from aml-org/w-14218793-sof
Browse files Browse the repository at this point in the history
W-14218793 - SOF fix in OAS 3 case
  • Loading branch information
BlockLucas authored Oct 17, 2023
2 parents aba2259 + a991989 commit 054eb63
Show file tree
Hide file tree
Showing 16 changed files with 1,860 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,15 @@ object DiagnosticConverters {
}
head match {
case (DocumentLink(range, _, _), origin) =>
if (originFlag)
branch.prepend(newDiagnostic(uri, range, origin))
else
branch.append(newDiagnostic(uri, range, origin))
relatedFor(origin, references, informationBranches, branch, branchLimit, originFlag)
val newD = newDiagnostic(uri, range, origin)
// avoid timeout by checking if we already added it, not using set as order is needed
if (!branch.contains(newD)) {
if (originFlag)
branch.prepend(newD)
else
branch.append(newD)
relatedFor(origin, references, informationBranches, branch, branchLimit, originFlag)
}
}
case _ => // over
}
Expand Down Expand Up @@ -135,7 +139,7 @@ object DiagnosticConverters {
): Seq[Seq[DiagnosticRelatedInformation]] = {
val informationBranches: ListBuffer[ListBuffer[DiagnosticRelatedInformation]] = mutable.ListBuffer()
val mainBranch: ListBuffer[DiagnosticRelatedInformation] = mutable.ListBuffer()
val branchLimit = 1000
val branchLimit = 100 // reduced to avoid sof
informationBranches.append(mainBranch)
relatedFor(uri, reversedReferences, informationBranches, mainBranch, branchLimit, originFlag)
informationBranches.size
Expand Down
325 changes: 325 additions & 0 deletions als-server/shared/src/test/resources/workspace/sof-test/api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,325 @@
openapi: "3.0.0"
info:
version: 1.0.0
title: api
description: sdf

servers:
- url: https://{platform}-{env}-test.com:443/api/api-{env}/{version}
description: a
variables:
platform:
enum: [asdf, fets]
default: asdf
description: name.
env:
enum: [dev, qa, stg, prod]
default: dev
description: Environment name.
version:
enum: [v1]
default: v1
description: API version.

paths:

/a:
parameters:
- $ref: common.yaml#/components/parameters/header-client-id
- $ref: common.yaml#/components/parameters/header-client-secret
- $ref: common.yaml#/components/parameters/request-token
get:
description: Get a
parameters:
- $ref: common.yaml#/components/parameters/qip
- $ref: common.yaml#/components/parameters/qis
- $ref: endpoint/a-endpoint.yaml#/components/parameters/qifd
- $ref: endpoint/a-endpoint.yaml#/components/parameters/qitd
- $ref: endpoint/a-endpoint.yaml#/components/parameters/qitp
- $ref: endpoint/a-endpoint.yaml#/components/parameters/qiis
responses:
"200":
$ref: endpoint/a-endpoint.yaml#/components/responses/a-response-200
"400":
$ref: common.yaml#/components/responses/error-response-400
"401":
$ref: common.yaml#/components/responses/error-response-401
"500":
$ref: common.yaml#/components/responses/error-response-500

/b/c:
parameters:
- $ref: common.yaml#/components/parameters/header-client-id
- $ref: common.yaml#/components/parameters/header-client-secret
- $ref: common.yaml#/components/parameters/request-token
get:
description: Get ha
parameters:
- name: csdc
in: query
required: true
schema:
type: string
format: date
- name: sdcsa
in: query
required: true
schema:
type: string
format: date
- $ref: common.yaml#/components/parameters/qip
- $ref: common.yaml#/components/parameters/qis
responses:
"200":
$ref: endpoint/a.yaml#/components/responses/a-response-200
"400":
$ref: common.yaml#/components/responses/error-response-400
"401":
$ref: common.yaml#/components/responses/error-response-401
"500":
$ref: common.yaml#/components/responses/error-response-500

/d/{idSF}/f:
parameters:
- $ref: common.yaml#/components/parameters/header-client-id
- $ref: common.yaml#/components/parameters/header-client-secret

patch:
description: s
requestBody:
required: true
content:
application/json:
schema:
$ref: 'endpoint/t-endpoint.yaml#/components/schemas/pfasd'
responses:
"200":
$ref: endpoint/t-endpoint.yaml#/components/responses/t-response-200
"400":
$ref: common.yaml#/components/responses/error-response-400
"401":
$ref: common.yaml#/components/responses/error-response-401
"500":
$ref: common.yaml#/components/responses/error-response-500

/tbs:
parameters:
- $ref: common.yaml#/components/parameters/header-client-id
- $ref: common.yaml#/components/parameters/header-client-secret
- $ref: common.yaml#/components/parameters/request-token
get:
description: bsf
parameters:
- $ref: endpoint/lkj.yaml#/components/parameters/qitp
- $ref: common.yaml#/components/parameters/qip
- $ref: common.yaml#/components/parameters/qis
responses:
"200":
$ref: endpoint/lkj.yaml#/components/responses/tbs-response-200
"400":
$ref: common.yaml#/components/responses/error-response-400
"401":
$ref: common.yaml#/components/responses/error-response-401
"500":
$ref: common.yaml#/components/responses/error-response-500

/h/{idSF}/tbs:
parameters:
- $ref: common.yaml#/components/parameters/header-client-id
- $ref: common.yaml#/components/parameters/header-client-secret
get:
description: dfg
responses:
"200":
$ref: endpoint/lkj.yaml#/components/responses/tbs-response-200
"400":
$ref: common.yaml#/components/responses/error-response-400
"404":
$ref: common.yaml#/components/responses/error-response-404
"401":
$ref: common.yaml#/components/responses/error-response-401
"500":
$ref: common.yaml#/components/responses/error-response-500

/m/absences:
parameters:
- $ref: common.yaml#/components/parameters/header-client-id
- $ref: common.yaml#/components/parameters/header-client-secret
- $ref: common.yaml#/components/parameters/request-token
get:
description: sfb
parameters:
- name: csdc
in: query
required: true
schema:
type: string
format: date
- name: sdcsa
in: query
required: true
schema:
type: string
format: date
- $ref: common.yaml#/components/parameters/qip
- $ref: common.yaml#/components/parameters/qis
responses:
"200":
$ref: endpoint/a.yaml#/components/responses/a-response-200
"400":
$ref: common.yaml#/components/responses/error-response-400
"401":
$ref: common.yaml#/components/responses/error-response-401
"500":
$ref: common.yaml#/components/responses/error-response-500


/c:
parameters:
- $ref: common.yaml#/components/parameters/header-client-id
- $ref: common.yaml#/components/parameters/header-client-secret
get:
description: fsv
parameters:
- $ref: endpoint/c-endpoint.yaml#/components/parameters/query-item-uid
responses:
"200":
$ref: endpoint/c-endpoint.yaml#/components/responses/c-response-200
"400":
$ref: common.yaml#/components/responses/error-response-400
"401":
$ref: common.yaml#/components/responses/error-response-401
"500":
$ref: common.yaml#/components/responses/error-response-500
post:
description: nrnb
requestBody:
required: true
content:
application/json:
schema:
$ref: 'endpoint/c-endpoint.yaml#/components/schemas/pco'
responses:
'201':
$ref: endpoint/c-endpoint.yaml#/components/responses/c-response-201
"400":
$ref: common.yaml#/components/responses/error-response-400
"401":
$ref: common.yaml#/components/responses/error-response-401
"500":
$ref: common.yaml#/components/responses/error-response-500

/m:
parameters:
- $ref: common.yaml#/components/parameters/header-client-id
- $ref: common.yaml#/components/parameters/header-client-secret
- $ref: common.yaml#/components/parameters/request-token
get:
description: dfvs
parameters:
- $ref: endpoint/df-endpoint.yaml#/components/parameters/qitp
- $ref: endpoint/df-endpoint.yaml#/components/parameters/qihi
- $ref: endpoint/df-endpoint.yaml#/components/parameters/qip
- $ref: common.yaml#/components/parameters/qip
- $ref: common.yaml#/components/parameters/qis
responses:
"200":
$ref: endpoint/df-endpoint.yaml#/components/responses/mr-200
"400":
$ref: common.yaml#/components/responses/error-response-400
"401":
$ref: common.yaml#/components/responses/error-response-401
"500":
$ref: common.yaml#/components/responses/error-response-500

/d:
parameters:
- $ref: common.yaml#/components/parameters/header-client-id
- $ref: common.yaml#/components/parameters/header-client-secret
- $ref: common.yaml#/components/parameters/request-token
get:
description: vsdvt
parameters:
- $ref: endpoint/d-endpoint.yaml#/components/parameters/qitp
- $ref: common.yaml#/components/parameters/qip
- $ref: common.yaml#/components/parameters/qis
responses:
"200":
$ref: endpoint/d-endpoint.yaml#/components/responses/d-200
"400":
$ref: common.yaml#/components/responses/error-response-400
"401":
$ref: common.yaml#/components/responses/error-response-401
"500":
$ref: common.yaml#/components/responses/error-response-500

/fasd:
parameters:
- $ref: common.yaml#/components/parameters/header-client-id
- $ref: common.yaml#/components/parameters/header-client-secret
- $ref: common.yaml#/components/parameters/request-token
get:
description: s
parameters:
- $ref: endpoint/pendpoint.yaml#/components/parameters/qitp
- $ref: common.yaml#/components/parameters/qip
- $ref: common.yaml#/components/parameters/qis
responses:
"200":
$ref: endpoint/pendpoint.yaml#/components/responses/p-response-200
"400":
$ref: common.yaml#/components/responses/error-response-400
"401":
$ref: common.yaml#/components/responses/error-response-401
"500":
$ref: common.yaml#/components/responses/error-response-500

/h/{idSF}/fasd:
parameters:
- $ref: common.yaml#/components/parameters/header-client-id
- $ref: common.yaml#/components/parameters/header-client-secret
get:
description: nrbdf
responses:
"200":
$ref: endpoint/pendpoint.yaml#/components/responses/p-response-200
"400":
$ref: common.yaml#/components/responses/error-response-400
"404":
$ref: common.yaml#/components/responses/error-response-404
"401":
$ref: common.yaml#/components/responses/error-response-401
"500":
$ref: common.yaml#/components/responses/error-response-500

/h:
parameters:
- $ref: "common.yaml#/components/parameters/header-client-id"
- $ref: "common.yaml#/components/parameters/header-client-secret"

post:
tags: [h]
operationId: post-h
summary: aksjdbf
description: brtbw
requestBody:
$ref: "endpoint/h-endpoint.yaml#/components/requestBodies/rbh"
responses:
'201':
$ref: "endpoint/h-endpoint.yaml#/components/responses/hr-201"
"400":
$ref: common.yaml#/components/responses/error-response-400
"401":
$ref: common.yaml#/components/responses/error-response-401
"500":
$ref: common.yaml#/components/responses/error-response-500

/as:
parameters:
- $ref: common.yaml#/components/parameters/header-client-id
- $ref: common.yaml#/components/parameters/header-client-secret
get:
description: trdfv
responses:
"200":
$ref: endpoint/as-endpoint.yaml#/components/responses/ar-200
Loading

0 comments on commit 054eb63

Please sign in to comment.