From c12b8739752a98838fab44095044c0ca1988a101 Mon Sep 17 00:00:00 2001 From: Alex Perez Date: Tue, 27 Jan 2026 16:14:23 -0300 Subject: [PATCH 1/4] feat: add gRPC API to the application and update API checks in ApiConsoleApp --- demo/themed/anypoint.js | 1 + src/ApiConsoleApp.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/demo/themed/anypoint.js b/demo/themed/anypoint.js index dcad66017..21174114d 100644 --- a/demo/themed/anypoint.js +++ b/demo/themed/anypoint.js @@ -13,6 +13,7 @@ class ApicApplication extends DemoBase { constructor() { super(); this.apis = [ + ['grpc-test', 'gRPC API'], ['google-drive-api', 'Google Drive API'], ['httpbin', 'HTTPbin API'], ['data-type-fragment', 'RAML data type fragment'], diff --git a/src/ApiConsoleApp.js b/src/ApiConsoleApp.js index 7548e3c41..4a92c5a37 100644 --- a/src/ApiConsoleApp.js +++ b/src/ApiConsoleApp.js @@ -204,7 +204,7 @@ export class ApiConsoleApp extends ApiConsole { if (!wideLayout || !isMethod ||inlineMethods) { return false; } - if (!this._isWebAPI(this.amf)) { + if (!this._isWebAPI(this.amf) || this._isGrpcApi(this.amf)) { return false; } return wideLayout; @@ -214,7 +214,7 @@ export class ApiConsoleApp extends ApiConsole { if (renderInlineTyit) { return true; } - if (!this._isWebAPI(this.amf)) { + if (!this._isWebAPI(this.amf) || this._isGrpcApi(this.amf)) { return true; } return noTryIt; From 119b1e6db00c61a6c42e4b89c1e15b0094e2ba99 Mon Sep 17 00:00:00 2001 From: Alex Perez Date: Tue, 27 Jan 2026 16:14:41 -0300 Subject: [PATCH 2/4] 6.6.56 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a3b91d3b9..1bd7c2d74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "api-console", - "version": "6.6.55", + "version": "6.6.56", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "api-console", - "version": "6.6.55", + "version": "6.6.56", "license": "CPAL-1.0", "dependencies": { "@advanced-rest-client/arc-icons": "^3.2.2", diff --git a/package.json b/package.json index 858edec36..ae9c5bc3b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "api-console", "description": "The API Console to automatically generate API documentation from RAML and OAS files.", - "version": "6.6.55", + "version": "6.6.56", "license": "CPAL-1.0", "main": "index.js", "module": "index.js", From 39d872b18622c006aff6ca27df72bc7a5357d322 Mon Sep 17 00:00:00 2001 From: Alex Perez Date: Tue, 27 Jan 2026 17:10:32 -0300 Subject: [PATCH 3/4] test: add unit tests for gRPC API support in ApiConsoleApp --- test/api-console-app.test.js | 263 +++++++++++++++++++++++++++++++++++ 1 file changed, 263 insertions(+) create mode 100644 test/api-console-app.test.js diff --git a/test/api-console-app.test.js b/test/api-console-app.test.js new file mode 100644 index 000000000..cb326df98 --- /dev/null +++ b/test/api-console-app.test.js @@ -0,0 +1,263 @@ +/* eslint-disable no-shadow */ +/* eslint-disable prefer-destructuring */ +import { fixture, assert, html, nextFrame, aTimeout } from '@open-wc/testing'; +import { AmfLoader } from './amf-loader.js'; +import '../api-console-app.js'; + +/** @typedef {import('../src/ApiConsoleApp.js').ApiConsoleApp} ApiConsoleApp */ + +describe('ApiConsoleApp', () => { + /** + * @returns {Promise} + */ + async function appFixture(amf) { + return fixture(html``); + } + + describe('gRPC API support', () => { + let grpcAmf; + let regularAmf; + + before(async () => { + grpcAmf = await AmfLoader.load({ fileName: 'grpc-test', compact: false }); + regularAmf = await AmfLoader.load({ fileName: 'demo-api', compact: false }); + }); + + describe('_computeRenderInlineTryIt()', () => { + it('returns false for gRPC API even with wideLayout and method', async () => { + const element = await appFixture(grpcAmf); + await nextFrame(); + + // Simulate wide layout and method selection + element.wideLayout = true; + element.selectedShapeType = 'method'; + await nextFrame(); + + const result = element._computeRenderInlineTryIt(true, true, false); + assert.isFalse(result, 'Should return false for gRPC API'); + }); + + it('returns true for regular WebAPI with wideLayout and method', async () => { + const element = await appFixture(regularAmf); + await nextFrame(); + + element.wideLayout = true; + element.selectedShapeType = 'method'; + await nextFrame(); + + const result = element._computeRenderInlineTryIt(true, true, false); + assert.isTrue(result, 'Should return true for regular WebAPI'); + }); + + it('returns false when not wideLayout', async () => { + const element = await appFixture(grpcAmf); + await nextFrame(); + + const result = element._computeRenderInlineTryIt(false, true, false); + assert.isFalse(result, 'Should return false when not wideLayout'); + }); + + it('returns false when not a method', async () => { + const element = await appFixture(grpcAmf); + await nextFrame(); + + const result = element._computeRenderInlineTryIt(true, false, false); + assert.isFalse(result, 'Should return false when not a method'); + }); + + it('returns false when inlineMethods is true', async () => { + const element = await appFixture(regularAmf); + await nextFrame(); + + const result = element._computeRenderInlineTryIt(true, true, true); + assert.isFalse(result, 'Should return false when inlineMethods is true'); + }); + + it('returns false when not WebAPI (e.g., AsyncAPI)', async () => { + const element = await appFixture(grpcAmf); + await nextFrame(); + + // Mock _isWebAPI to return false + const originalIsWebAPI = element._isWebAPI; + element._isWebAPI = () => false; + + const result = element._computeRenderInlineTryIt(true, true, false); + assert.isFalse(result, 'Should return false when not WebAPI'); + + // Restore original method + element._isWebAPI = originalIsWebAPI; + }); + }); + + describe('_computeNoTryItValue()', () => { + it('returns true for gRPC API', async () => { + const element = await appFixture(grpcAmf); + await nextFrame(); + + const result = element._computeNoTryItValue(false, false); + assert.isTrue(result, 'Should return true for gRPC API'); + }); + + it('returns false for regular WebAPI when noTryIt is false', async () => { + const element = await appFixture(regularAmf); + await nextFrame(); + + const result = element._computeNoTryItValue(false, false); + assert.isFalse(result, 'Should return false for regular WebAPI'); + }); + + it('returns true when renderInlineTyit is true', async () => { + const element = await appFixture(regularAmf); + await nextFrame(); + + const result = element._computeNoTryItValue(false, true); + assert.isTrue(result, 'Should return true when renderInlineTyit is true'); + }); + + it('returns true when noTryIt is explicitly true', async () => { + const element = await appFixture(regularAmf); + await nextFrame(); + + const result = element._computeNoTryItValue(true, false); + assert.isTrue(result, 'Should return true when noTryIt is true'); + }); + + it('returns true when not WebAPI', async () => { + const element = await appFixture(grpcAmf); + await nextFrame(); + + // Mock _isWebAPI to return false + const originalIsWebAPI = element._isWebAPI; + element._isWebAPI = () => false; + + const result = element._computeNoTryItValue(false, false); + assert.isTrue(result, 'Should return true when not WebAPI'); + + // Restore original method + element._isWebAPI = originalIsWebAPI; + }); + }); + + describe('try-panel rendering', () => { + it('does not render inline try-panel for gRPC API', async () => { + const element = await appFixture(grpcAmf); + await nextFrame(); + + // Set wide layout and select a method + element.wideLayout = true; + const webApi = AmfLoader.lookupWebApi(grpcAmf); + const endpoints = element._computeEndpoints(webApi); + if (endpoints && endpoints.length > 0) { + const operations = element._computePropertyArray( + endpoints[0], + element.ns.aml.vocabularies.apiContract.supportedOperation + ); + if (operations && operations.length > 0) { + element.selectedShape = operations[0]['@id']; + element.selectedShapeType = 'method'; + await nextFrame(); + await nextFrame(); + + // Check that inline try-panel is not rendered + const inlineRequest = element.shadowRoot.querySelector('.inline-request'); + assert.isNull(inlineRequest, 'Inline try-panel should not be rendered for gRPC API'); + } + } + }); + + it('hides try-it button for gRPC API', async () => { + const element = await appFixture(grpcAmf); + await nextFrame(); + + // Select a method + const webApi = AmfLoader.lookupWebApi(grpcAmf); + const endpoints = element._computeEndpoints(webApi); + if (endpoints && endpoints.length > 0) { + const operations = element._computePropertyArray( + endpoints[0], + element.ns.aml.vocabularies.apiContract.supportedOperation + ); + if (operations && operations.length > 0) { + element.selectedShape = operations[0]['@id']; + element.selectedShapeType = 'method'; + await nextFrame(); + await nextFrame(); + + // Check that _noTryItValue is true + assert.isTrue(element._noTryItValue, 'Try-it button should be hidden for gRPC API'); + } + } + }); + }); + + describe('_isGrpcApi() detection', () => { + it('correctly detects gRPC API', async () => { + const element = await appFixture(grpcAmf); + await nextFrame(); + + const isGrpc = element._isGrpcApi(grpcAmf); + assert.isTrue(isGrpc, 'Should detect gRPC API'); + }); + + it('correctly detects non-gRPC API', async () => { + const element = await appFixture(regularAmf); + await nextFrame(); + + const isGrpc = element._isGrpcApi(regularAmf); + assert.isFalse(isGrpc, 'Should not detect regular API as gRPC'); + }); + + it('returns false when amf is null or undefined', async () => { + const element = await appFixture(regularAmf); + await nextFrame(); + + const isGrpcNull = element._isGrpcApi(null); + const isGrpcUndefined = element._isGrpcApi(undefined); + + assert.isFalse(isGrpcNull, 'Should return false for null'); + assert.isFalse(isGrpcUndefined, 'Should return false for undefined'); + }); + }); + + describe('_updateRenderInlineTyit() integration', () => { + it('updates _renderInlineTryit and _noTryItValue when wideLayout changes', async () => { + const element = await appFixture(regularAmf); + await nextFrame(); + + element.selectedShapeType = 'method'; + element.wideLayout = true; + await nextFrame(); + + assert.isTrue(element._renderInlineTryit, 'Should render inline tryit for regular API'); + assert.isTrue(element._noTryItValue, 'Should hide try-it button when inline is rendered'); + }); + + it('updates _renderInlineTryit and _noTryItValue when switching to gRPC API', async () => { + const element = await appFixture(regularAmf); + await nextFrame(); + + element.wideLayout = true; + element.selectedShapeType = 'method'; + await nextFrame(); + await element.updateComplete; + + // Initially should render inline tryit for regular API + assert.isTrue(element._renderInlineTryit, 'Should initially render inline tryit'); + + // Switch to gRPC API + element.amf = grpcAmf; + await element.updateComplete; + await nextFrame(); + + // Manually trigger update since _processModelChange doesn't call _updateRenderInlineTyit + // (to avoid performance issues with large APIs) + element._updateRenderInlineTyit(); + await element.updateComplete; + + // Should not render inline tryit for gRPC + assert.isFalse(element._renderInlineTryit, 'Should not render inline tryit for gRPC'); + assert.isTrue(element._noTryItValue, 'Should hide try-it button for gRPC'); + }); + }); + }); +}); From d505c0fff43dba66fd219ac58545b3f50ebc3f2b Mon Sep 17 00:00:00 2001 From: Alex Perez Date: Wed, 28 Jan 2026 11:05:05 -0300 Subject: [PATCH 4/4] feat: add grpc-test.json model for gRPC API request and response structures and update .gitignore to include the new file --- .gitignore | 1 + demo/models/grpc-test.json | 1045 ++++++++++++++++++++++++++++++++++++ 2 files changed, 1046 insertions(+) create mode 100644 demo/models/grpc-test.json diff --git a/.gitignore b/.gitignore index c2f5e907f..8a4b5f22b 100644 --- a/.gitignore +++ b/.gitignore @@ -65,6 +65,7 @@ demo/models/flattened/*.json !demo/models/jldAsync26.json !demo/models/avro.json !demo/models/avro2.json +!demo/models/grpc-test.json .idea/ .sfdx diff --git a/demo/models/grpc-test.json b/demo/models/grpc-test.json new file mode 100644 index 000000000..0c5168e66 --- /dev/null +++ b/demo/models/grpc-test.json @@ -0,0 +1,1045 @@ +[ + { + "@id": "", + "doc:declares": [ + { + "@id": "#1", + "@type": [ + "sh:NodeShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:property": [ + { + "@id": "#2", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#3", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string", + "__apicResolved": true + } + ], + "__apicResolved": true + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 1, + "__apicResolved": true + } + ], + "sh:name": [ + { + "@value": "query", + "__apicResolved": true + } + ], + "__apicResolved": true + }, + { + "@id": "#4", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#5", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#integer", + "__apicResolved": true + } + ], + "raml-shapes:format": [ + { + "@value": "int32", + "__apicResolved": true + } + ], + "__apicResolved": true + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 2, + "__apicResolved": true + } + ], + "sh:name": [ + { + "@value": "page_number", + "__apicResolved": true + } + ], + "__apicResolved": true + }, + { + "@id": "#6", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#7", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#integer", + "__apicResolved": true + } + ], + "raml-shapes:format": [ + { + "@value": "int32", + "__apicResolved": true + } + ], + "__apicResolved": true + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 3, + "__apicResolved": true + } + ], + "sh:name": [ + { + "@value": "results_per_page", + "__apicResolved": true + } + ], + "__apicResolved": true + } + ], + "sh:name": [ + { + "@value": ".test_grpc_FF.SearchRequest", + "__apicResolved": true + } + ], + "core:name": [ + { + "@value": "SearchRequest", + "__apicResolved": true + } + ], + "__apicResolved": true + }, + { + "@id": "#9", + "@type": [ + "sh:NodeShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:property": [ + { + "@id": "#10", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#11", + "@type": [ + "raml-shapes:ArrayShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:items": [ + { + "@id": "#12", + "@type": [ + "sh:NodeShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:property": [ + { + "@id": "#13", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#14", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ] + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 1 + } + ], + "sh:name": [ + { + "@value": "url" + } + ] + }, + { + "@id": "#15", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#16", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ] + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 2 + } + ], + "sh:name": [ + { + "@value": "title" + } + ] + }, + { + "@id": "#17", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#18", + "@type": [ + "raml-shapes:ArrayShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:items": [ + { + "@id": "#19", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ] + } + ] + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 3 + } + ], + "sh:name": [ + { + "@value": "snippets" + } + ] + } + ], + "sh:name": [ + { + "@value": ".test_grpc_FF.Result" + } + ], + "core:name": [ + { + "@value": "Result" + } + ] + } + ] + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 1 + } + ], + "sh:name": [ + { + "@value": "results" + } + ] + } + ], + "sh:name": [ + { + "@value": ".test_grpc_FF.SearchResponse" + } + ], + "core:name": [ + { + "@value": "SearchResponse" + } + ] + }, + { + "@id": "#12", + "@type": [ + "sh:NodeShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:property": [ + { + "@id": "#13", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#14", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ] + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 1 + } + ], + "sh:name": [ + { + "@value": "url" + } + ] + }, + { + "@id": "#15", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#16", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ] + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 2 + } + ], + "sh:name": [ + { + "@value": "title" + } + ] + }, + { + "@id": "#17", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#18", + "@type": [ + "raml-shapes:ArrayShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:items": [ + { + "@id": "#19", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ] + } + ] + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 3 + } + ], + "sh:name": [ + { + "@value": "snippets" + } + ] + } + ], + "sh:name": [ + { + "@value": ".test_grpc_FF.Result" + } + ], + "core:name": [ + { + "@value": "Result" + } + ] + } + ], + "@type": [ + "doc:Document", + "doc:Fragment", + "doc:Module", + "doc:Unit" + ], + "doc:encodes": [ + { + "@id": "#22", + "@type": [ + "apiContract:WebAPI", + "apiContract:API", + "doc:RootDomainElement", + "doc:DomainElement" + ], + "core:name": [ + { + "@value": "test_grpc_FF" + } + ], + "apiContract:endpoint": [ + { + "@id": "#23", + "@type": [ + "apiContract:EndPoint", + "doc:DomainElement" + ], + "core:name": [ + { + "@value": "SearchService" + } + ], + "apiContract:supportedOperation": [ + { + "@id": "#24", + "@type": [ + "apiContract:Operation", + "core:Operation", + "doc:DomainElement" + ], + "apiContract:method": [ + { + "@value": "post" + } + ], + "core:name": [ + { + "@value": "Search" + } + ], + "apiContract:expects": [ + { + "@id": "#25", + "@type": [ + "apiContract:Request", + "core:Request", + "apiContract:Message", + "doc:DomainElement" + ], + "apiContract:payload": [ + { + "@id": "#26", + "@type": [ + "apiContract:Payload", + "core:Payload", + "doc:DomainElement" + ], + "core:mediaType": [ + { + "@value": "application/grpc" + } + ], + "raml-shapes:schema": [ + { + "@id": "#1", + "@type": [ + "sh:NodeShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:property": [ + { + "@id": "#2", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#3", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string", + "__apicResolved": true + } + ], + "__apicResolved": true + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 1, + "__apicResolved": true + } + ], + "sh:name": [ + { + "@value": "query", + "__apicResolved": true + } + ], + "__apicResolved": true + }, + { + "@id": "#4", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#5", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#integer", + "__apicResolved": true + } + ], + "raml-shapes:format": [ + { + "@value": "int32", + "__apicResolved": true + } + ], + "__apicResolved": true + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 2, + "__apicResolved": true + } + ], + "sh:name": [ + { + "@value": "page_number", + "__apicResolved": true + } + ], + "__apicResolved": true + }, + { + "@id": "#6", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#7", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#integer", + "__apicResolved": true + } + ], + "raml-shapes:format": [ + { + "@value": "int32", + "__apicResolved": true + } + ], + "__apicResolved": true + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 3, + "__apicResolved": true + } + ], + "sh:name": [ + { + "@value": "results_per_page", + "__apicResolved": true + } + ], + "__apicResolved": true + } + ], + "sh:name": [ + { + "@value": ".test_grpc_FF.SearchRequest", + "__apicResolved": true + } + ], + "core:name": [ + { + "@value": "SearchRequest", + "__apicResolved": true + } + ], + "__apicResolved": true + } + ] + } + ] + } + ], + "apiContract:returns": [ + { + "@id": "#27", + "@type": [ + "apiContract:Response", + "core:Response", + "apiContract:Message", + "doc:DomainElement" + ], + "apiContract:payload": [ + { + "@id": "#28", + "@type": [ + "apiContract:Payload", + "core:Payload", + "doc:DomainElement" + ], + "core:mediaType": [ + { + "@value": "application/protobuf" + } + ], + "raml-shapes:schema": [ + { + "@id": "#9", + "@type": [ + "sh:NodeShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:property": [ + { + "@id": "#10", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#11", + "@type": [ + "raml-shapes:ArrayShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:items": [ + { + "@id": "#12", + "@type": [ + "sh:NodeShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:property": [ + { + "@id": "#13", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#14", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ] + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 1 + } + ], + "sh:name": [ + { + "@value": "url" + } + ] + }, + { + "@id": "#15", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#16", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ] + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 2 + } + ], + "sh:name": [ + { + "@value": "title" + } + ] + }, + { + "@id": "#17", + "@type": [ + "sh:PropertyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:range": [ + { + "@id": "#18", + "@type": [ + "raml-shapes:ArrayShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "raml-shapes:items": [ + { + "@id": "#19", + "@type": [ + "raml-shapes:ScalarShape", + "raml-shapes:AnyShape", + "sh:Shape", + "raml-shapes:Shape", + "doc:DomainElement" + ], + "sh:datatype": [ + { + "@id": "http://www.w3.org/2001/XMLSchema#string" + } + ] + } + ] + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 3 + } + ], + "sh:name": [ + { + "@value": "snippets" + } + ] + } + ], + "sh:name": [ + { + "@value": ".test_grpc_FF.Result" + } + ], + "core:name": [ + { + "@value": "Result" + } + ] + } + ] + } + ], + "raml-shapes:serializationOrder": [ + { + "@value": 1 + } + ], + "sh:name": [ + { + "@value": "results" + } + ] + } + ], + "sh:name": [ + { + "@value": ".test_grpc_FF.SearchResponse" + } + ], + "core:name": [ + { + "@value": "SearchResponse" + } + ] + } + ] + } + ] + } + ], + "apiContract:operationId": [ + { + "@value": "Search" + } + ] + } + ] + } + ] + } + ], + "doc:root": [ + { + "@value": true + } + ], + "doc:package": [ + { + "@value": "test_grpc_FF" + } + ], + "doc:processingData": [ + { + "@id": "#29", + "@type": [ + "doc:APIContractProcessingData" + ], + "apiContract:modelVersion": [ + { + "@value": "3.11.0" + } + ], + "doc:transformed": [ + { + "@value": true + } + ], + "doc:sourceSpec": [ + { + "@value": "Grpc" + } + ] + } + ], + "sourcemaps:sources": [ + { + "@id": "#/source-map", + "@type": [ + "sourcemaps:SourceMap" + ], + "sourcemaps:grpc-raw-proto": [ + { + "@id": "#/source-map/grpc-raw-proto/element_0", + "sourcemaps:element": [ + { + "@value": "amf://id" + } + ], + "sourcemaps:value": [ + { + "@value": "\nsyntax = \"proto3\";\n\npackage test_grpc_FF;\n\nmessage SearchRequest {\n string query = 1;\n int32 page_number = 2;\n int32 results_per_page = 3;\n}\n\nmessage SearchResponse {\n repeated Result results = 1;\n}\n\nmessage Result {\n string url = 1;\n string title = 2;\n repeated string snippets = 3;\n}\n\nservice SearchService {\n rpc Search(SearchRequest) returns (SearchResponse);\n}" + } + ] + } + ] + } + ], + "@context": { + "@base": "amf://id", + "raml-shapes": "http://a.ml/vocabularies/shapes#", + "doc": "http://a.ml/vocabularies/document#", + "apiContract": "http://a.ml/vocabularies/apiContract#", + "core": "http://a.ml/vocabularies/core#", + "sourcemaps": "http://a.ml/vocabularies/document-source-maps#", + "sh": "http://www.w3.org/ns/shacl#" + } + } +] \ No newline at end of file