[ ] Feature request
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x ] Bug report
[ ] Documentation issue or request
Expected Result:
Actual Result
Seems that the global tags contain a JSON object whereas they should contain a string array, that's odd, but it is ignored by the parser. What causes the issue is that the tags of the GET operation contains / character. Which is included as a key in actionCountByTags.
Converted to YAML
swagger: '2.0'
info:
version: '1.0'
title: Greeting REST API
basePath: /camel/
tags:
- name: greetings/
description: 'Greeting to {name}'
schemes:
- http
paths:
'/greetings/{name}':
get:
tags:
- greetings/
...
This leads to error when persisting:
io.syndesis.server.jsondb.JsonDBException: Invalid key. Cannot contain ., %, $, #, [, ], /, or ASCII control characters 0-31 or 127. Key: greetings/
at io.syndesis.server.jsondb.impl.JsonRecordSupport.validateKey(JsonRecordSupport.java:124) ~[server-jsondb-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.jsondb.impl.JsonRecordSupport.jsonStreamToRecords(JsonRecordSupport.java:144) ~[server-jsondb-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.jsondb.impl.JsonRecordSupport.jsonStreamToRecords(JsonRecordSupport.java:144) ~[server-jsondb-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.jsondb.impl.JsonRecordSupport.jsonStreamToRecords(JsonRecordSupport.java:144) ~[server-jsondb-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.jsondb.impl.JsonRecordSupport.jsonStreamToRecords(JsonRecordSupport.java:144) ~[server-jsondb-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.jsondb.impl.JsonRecordSupport.jsonStreamToRecords(JsonRecordSupport.java:91) ~[server-jsondb-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.jsondb.impl.SqlJsonDB.lambda$set$17(SqlJsonDB.java:443) ~[server-jsondb-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.jsondb.impl.SqlJsonDB.withTransaction(SqlJsonDB.java:558) ~[server-jsondb-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.jsondb.impl.SqlJsonDB.set(SqlJsonDB.java:438) ~[server-jsondb-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.jsondb.JsonDB.set(JsonDB.java:137) ~[server-jsondb-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.jsondb.dao.JsonDbDao.create(JsonDbDao.java:161) ~[server-jsondb-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.dao.manager.DataManager.lambda$create$6(DataManager.java:320) ~[server-dao-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.dao.manager.DataManager.doWithDataAccessObject(DataManager.java:438) ~[server-dao-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.dao.manager.DataManager.create(DataManager.java:320) ~[server-dao-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.endpoint.v1.operations.Creator.create(Creator.java:36) ~[server-endpoint-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
at io.syndesis.server.endpoint.v1.handler.connection.ConnectionHandler.create(ConnectionHandler.java:173) ~[server-endpoint-1.5-SNAPSHOT.jar!/:1.5-SNAPSHOT]
{"connector":{"connectorGroup":{"id":"swagger-connector-template"},"connectorGroupId":"swagger-connector-template","description":"unspecified","icon":"data:image/svg+xml,...","actionsSummary":{"actionCountByTags":{"greetings/":1},"totalActions":1},"uses":0,"id":"i-LNU3EkvR6BhTm3sXS80z","version":1,"actions":[{"id":"io.syndesis.connector:connector-rest-swagger:1.5-SNAPSHOT:i-LNU3EkvR6BhTm3sXS80z:greeting-api","name":"GET /greetings/{name}","description":"Send GET request to /greetings/{name}","descriptor":{"connectorId":"i-LNU3EkvR6BhTm3sXS80z","camelConnectorGAV":"io.syndesis.connector:connector-rest-swagger:1.5-SNAPSHOT","camelConnectorPrefix":"swagger-operation","inputDataShape":{"name":"Request","description":"API request payload","kind":"json-schema","specification":"{\"$schema\":\"http://json-schema.org/draft-04/schema#\",\"type\":\"object\",\"properties\":{\"parameters\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\",\"title\":\"name\"}}}}}"},"outputDataShape":{"name":"Response","description":"API response payload","kind":"json-schema","specification":"{\"$schema\":\"http://json-schema.org/draft-04/schema#\",\"type\":\"object\",\"title\":\"Greetings\",\"properties\":{\"greetings\":{\"type\":\"string\"},\"from\":{\"type\":\"string\"}}}"},"configuredProperties":{"operationId":"greeting-api"}},"tags":["greetings/"],"actionType":"connector","dependencies":[{"type":"MAVEN","id":"io.syndesis.connector:connector-rest-swagger:1.5-SNAPSHOT"}],"pattern":"To"}],"name":"Greeting REST API","properties":{"authenticationType":{"componentProperty":true,"defaultValue":"none","deprecated":false,"description":"Type of authentication used to connect to the API","displayName":"Authentication Type","group":"producer","javaType":"java.lang.String","kind":"property","label":"producer","required":false,"secret":false,"type":"string","tags":["authentication-type"],"order":1,"enum":[{"label":"No Security","value":"none"}]},"basePath":{"componentProperty":true,"defaultValue":"/camel/","deprecated":false,"description":"API basePath for example /v2. Default is unset if set overrides the value present in OpenAPI specification.","displayName":"Base path","group":"producer","javaType":"java.lang.String","kind":"property","label":"producer","required":true,"secret":false,"type":"string","order":11},"host":{"componentProperty":true,"deprecated":false,"description":"Scheme hostname and port to direct the HTTP requests to in the form of https://hostname:port.","displayName":"Host","group":"producer","javaType":"java.lang.String","kind":"property","label":"producer","required":true,"secret":false,"type":"string","order":10},"specification":{"componentProperty":true,"deprecated":false,"description":"OpenAPI specification of the service","displayName":"Specification","group":"producer","javaType":"java.lang.String","kind":"property","label":"producer","required":true,"secret":false,"type":"hidden","tags":["upload","url"]}},"configuredProperties":{"authenticationType":"none","basePath":"/camel/","specification":"{\"swagger\":\"2.0\",\"basePath\":\"/camel/\",\"schemes\":[\"http\"],\"paths\":{\"/greetings/{name}\":{\"get\":{\"operationId\":\"greeting-api\",\"parameters\":[{\"name\":\"name\",\"in\":\"path\"}]}}}}"}},"icon":"data:image/svg+xml,...","connectorId":"i-LNU3EkvR6BhTm3sXS80z","configuredProperties":{"specification":"{\"swagger\":\"2.0\",\"basePath\":\"/camel/\",\"schemes\":[\"http\"],\"paths\":{\"/greetings/{name}\":{\"get\":{\"operationId\":\"greeting-api\",\"parameters\":[{\"name\":\"name\",\"in\":\"path\"}]}}}}","authenticationType":"none","host":"http://example.com","basePath":"/camel/"},"name":"Greetings Connection","description":null}
Just an FYI, this is Swagger generated from the Fuse REST mission on launch.openshift.io - so just for completeness, if this is partially a Swagger generation issue then we need to look at that as well.
@valdar can you take a look at above comment and see if this is a Camel or a bootstrap issue?
@mastepan please verify the fix provided
checked on
Version
Syndesis:
1.5-SNAPSHOT
Build ID:
f8f3f307-43db-43af-abda-5f3b89b4e986
Commit ID:
f3d9b760f47ae96646407689355f222f14a98e47
Hitting Create button still doesn't create a connection.
Moving back to the backlog for review
@mastepan are you using the provided Swagger JSON or a different one? I've created a Custom API client form the provided Swagger JSON on staging without issues.
@zregvart yes, I use this one. @tplevko couldn't have reproduced it but I still can. I'll try to reinstall syndesis and we'll see.
//EDIT: The note with tplevko was intended for another issue. Sorry ;)
@zregvart I tried this on Version
Syndesis:
1.5.4-20181008
Commit ID:
ad0ef92a4938f5d16e04a0ed11c26c5d648dfec0
The result is the same. Create button doesn't do anything. I fill a random value to host field when creating the connection. I hope this isn't the problem (hidden validation or so...). I don't know what host url I should use.
@mastepan anything on the browser console or in the network tab that might point to an error on the client or the server side? The original issue would manifest itself in the syndesis-server POD's log, there would be a stacktrace mentioning JsonDB.
@zregvart JsonDBException is there...
syndesis-server-1.log
Thanks for the error log @mastepan really helpful, I found two other paces tags waren't sanitized.
The last fix works. Verified on 1.5.4-20181010
Thanks for verifying @mastepan
Fixed in the boosters as well.