Skip to content

Commit 1aaea43

Browse files
committed
Merge branch 'release'
2 parents 88cf3f8 + b170972 commit 1aaea43

File tree

6 files changed

+55
-20
lines changed

6 files changed

+55
-20
lines changed

package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@netcracker/qubership-apihub-api-processor",
3-
"version": "4.2.0",
3+
"version": "4.2.1",
44
"description": "",
55
"license": "Apache-2.0",
66
"module": "dist/esm/src/index.js",
@@ -31,8 +31,8 @@
3131
"update-lock-file": "update-lock-file @netcracker"
3232
},
3333
"dependencies": {
34-
"@netcracker/qubership-apihub-api-diff": "2.3.0",
35-
"@netcracker/qubership-apihub-api-unifier": "2.4.0",
34+
"@netcracker/qubership-apihub-api-diff": "2.4.0",
35+
"@netcracker/qubership-apihub-api-unifier": "2.4.1",
3636
"@netcracker/qubership-apihub-graphapi": "1.0.8",
3737
"@netcracker/qubership-apihub-json-crawl": "1.0.4",
3838
"adm-zip": "0.5.10",

src/apitypes/rest/rest.utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ export const getOperationBasePath = (servers?: OpenAPIV3.ServerObject[]): string
2727
try {
2828
const [firstServer] = servers
2929
let serverUrl = firstServer.url
30+
if(!serverUrl) {
31+
return ''
32+
}
33+
3034
const { variables = {} } = firstServer
3135

3236
for (const param of Object.keys(variables)) {

test/bugs.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,4 +342,18 @@ describe('Operation Bugs', () => {
342342

343343
expect(editor.builder.operationList.every(operation => operation.apiKind === API_KIND.NO_BWC)).toBeTruthy()
344344
})
345+
346+
test('should correctly calculate operationId for servers with incorrect URL', async () => {
347+
const editor = await Editor.openProject('bugs', bugsPackage)
348+
349+
const result = await editor.run({
350+
version: 'v1',
351+
files: [
352+
{ fileId: 'should-correctly-calculate-operation-id-for-servers-with-incorrect-url.yaml', publish: true },
353+
],
354+
})
355+
356+
const operationKeys = Array.from(result.operations.keys())
357+
expect(operationKeys[0]).toEqual('paths1-get')
358+
})
345359
})

test/projects/bugs/docs/Markdown_example.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Supports OpenAPI and GraphQL specifications processing.
88
- Added cycles support during combiners resolve
99
- Added origins support- it is now possible for any value in the unified JSO to track its origins in the source specification
1010
- Store original ref for the object if the object was resolved from ref
11-
- Gathered various API unification adapters from different libraries in the stack to a single place
11+
- Gathered various API unification adapters from different libraries in the stack to a single place
1212
- Support data structure hash calculation
1313
- Process different phases sequentially (reference resolving, allOf merge, unification)
1414
- Support synthetic `any` and `nothing` type for OAS
@@ -26,14 +26,14 @@ Supports OpenAPI and GraphQL specifications processing.
2626
- Correctly merge additionalProperties, patternProperties and properties taking into account common validations
2727
- Correctly merge items and additionalItems taking into account common validations
2828
- Supports custom rules to merge other document types and JsonSchema versions
29-
- Supports input with circular references (javaScript references)
29+
- Supports input with circular references (JavaScript references)
3030
- Supports $refs and circular $refs either (internal references only)
3131
- Correctly merge of $refs with sibling content (optionally)
3232
- Correctly merge of combiners (anyOf, oneOf) with sibling content (optionally)
33-
- Typescript syntax support out of the box
34-
- No dependencies (except json-crawl), can be used in NodeJS or browser
33+
- TypeScript syntax support out of the box
34+
- No dependencies (except json-crawl), can be used in Node.js or browser
3535

36-
## Works perfectly with specifications:
36+
## Works perfectly with specifications
3737

3838
- [JsonSchema](https://json-schema.org/draft/2020-12/json-schema-core.html)
3939
- [OpenApi 3.x](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md)
@@ -43,7 +43,7 @@ Supports OpenAPI and GraphQL specifications processing.
4343
- ~~AsyncApi 3.x~~ (roadmap)
4444

4545
## Other libraries
46-
There are some libraries that can merge schemas combined with allOf. One of the most popular is [mokkabonna/json-schema-merge-allof](https://www.npmjs.com/package/json-schema-merge-allof), but it has some limitatons: Does not support circular $refs and no Typescript syntax out of the box.
46+
There are some libraries that can merge schemas combined with allOf. One of the most popular is [mokkabonna/json-schema-merge-allof](https://npmjs.com/package/json-schema-merge-allof), but it has some limitatons: Does not support circular $refs and no TypeScript syntax out of the box.
4747

4848
## License
4949

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
openapi: 3.0.3
2+
info:
3+
title: test
4+
version: 1.0.0
5+
servers:
6+
- url: []
7+
paths:
8+
/paths1:
9+
get:
10+
description: test
11+
responses:
12+
'200':
13+
description: Success
14+
content:
15+
application/json:
16+
schema:
17+
type: object

0 commit comments

Comments
 (0)