[JBoss JIRA] (ERT-214) Validate JSON file with JSON Schema [EBZ#494111]
by Friendly Jira Robot (JIRA)
Friendly Jira Robot created ERT-214:
---------------------------------------
Summary: Validate JSON file with JSON Schema [EBZ#494111]
Key: ERT-214
URL: https://issues.jboss.org/browse/ERT-214
Project: Eclipse Release Train
Issue Type: Task
Components: WTP Source Editing
Reporter: Friendly Jira Robot
Priority: Trivial
It's a very big task, but it should be fantastic if WTP Validator could validate JSON file by using JSON Schema.
To do that:
* JSONSchemaDocument should support the full specification of JSON Schema.
* minimal-json should be improved to collect line, column or perhaps we could use IJSONDocument to validate it with JSON Schema.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (ERT-215) Improve JSON completion apply according the JSON Schema [EBZ#494114]
by Friendly Jira Robot (JIRA)
Friendly Jira Robot created ERT-215:
---------------------------------------
Summary: Improve JSON completion apply according the JSON Schema [EBZ#494114]
Key: ERT-215
URL: https://issues.jboss.org/browse/ERT-215
Project: Eclipse Release Train
Issue Type: Task
Components: WTP Source Editing
Reporter: Friendly Jira Robot
Priority: Trivial
Today, when JSON completion item is applied, it generates the "name" and "value" fields. According the JSON Schema, it generates for instance "false" as value if the JSON field is declared as "boolean" in the JSON Schema.
I think we could improve this behaviour:
* apply completion should show a second popup for boolean value ( with "true", "false").
* apply completion should generate "true" if JSON Schema "default" declare it as "true"
* apply completion should use JSON Schema "enum" to show a second popup with "enum" values.
* apply completion should generate a JSON Object with JSON pair which declare some "name" JSON fields as "required".
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (JBIDE-22426) Connection: authorization strategy is always overwritten (in the client) upon #isConnected
by Andre Dietisheim (JIRA)
[ https://issues.jboss.org/browse/JBIDE-22426?page=com.atlassian.jira.plugi... ]
Andre Dietisheim updated JBIDE-22426:
-------------------------------------
Git Pull Request: https://github.com/jbosstools/jbosstools-openshift/pull/1179, https://github.com/jbosstools/jbosstools-openshift/pull/1173, https://github.com/jbosstools/jbosstools-openshift/pull/1185 (was: https://github.com/jbosstools/jbosstools-openshift/pull/1179, https://github.com/jbosstools/jbosstools-openshift/pull/1173)
> Connection: authorization strategy is always overwritten (in the client) upon #isConnected
> -------------------------------------------------------------------------------------------
>
> Key: JBIDE-22426
> URL: https://issues.jboss.org/browse/JBIDE-22426
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.4.0.Alpha3
> Reporter: Andre Dietisheim
> Assignee: Andre Dietisheim
> Labels: connection, openshift_v3
> Fix For: 4.4.0.Alpha3
>
>
> The current implementation of Connection#isConnected() will always overwrite the authorization strategy in the client that it is using. This seems wrong given that #getResources, #createResource, #updateResource (and other methods) also set it but check if it already exists beforehand. Making sure that they dont overwrite an existing strategy.
> {code:title=Connection#isConnected}
> public boolean isConnected(IProgressMonitor monitor) {
> client.setAuthorizationStrategy(getAuthorizationStrategy());
> try {
> {code}
> {code:title=Connection#createResource}
> public <T extends IResource> T createResource(T resource) {
> try {
> if(client.getAuthorizationStrategy() == null) {
> client.setAuthorizationStrategy(getAuthorizationStrategy());
> }
> return client.create(resource);
> {code}
> A very likely side-effect of this is in Connection#ownsResource which compares clients (the one in the connection and the one attached to the given resource. The 2 clients are compared with the authorization strategy:
> {code:title=com.openshift.internal.restclient.DefaultClient#equals}
> @Override
> public boolean equals(Object obj) {
> ...
> return ObjectUtils.equals(strategy, other.strategy);
> {code}
> the lookup for a connection for a given resource in ConnectionRegistryUtils#safeGetConnectionFor will therefore fail after a Connection#isConnected:
> {code:title=ConnectionsRegistryUtil#safeGetConnectionFor(IResource)}
> public static Connection safeGetConnectionFor(IResource resource) {
> Collection<Connection> all = ConnectionsRegistrySingleton.getInstance().getAll(Connection.class);
> for (Connection connection : all) {
> if(connection.ownsResource(resource)) {
> return connection;
> }
> }
> return null;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months
[JBoss JIRA] (JBIDE-22426) Connection: authorization strategy is always overwritten (in the client) upon #isConnected
by Viacheslav Kabanovich (JIRA)
[ https://issues.jboss.org/browse/JBIDE-22426?page=com.atlassian.jira.plugi... ]
Viacheslav Kabanovich commented on JBIDE-22426:
-----------------------------------------------
[~adietish], please consider https://github.com/jbosstools/jbosstools-openshift/pull/1185 - prevention of possible unwanted connect() in isConnected(). The hole was not a big one - for the very first access to the connection, but still it might make the start of Deploy image wizard from Docker explorer behave not as planned (separate Sign In dialog instead of Sign In page in the wizard).
> Connection: authorization strategy is always overwritten (in the client) upon #isConnected
> -------------------------------------------------------------------------------------------
>
> Key: JBIDE-22426
> URL: https://issues.jboss.org/browse/JBIDE-22426
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.4.0.Alpha3
> Reporter: Andre Dietisheim
> Assignee: Andre Dietisheim
> Labels: connection, openshift_v3
> Fix For: 4.4.0.Alpha3
>
>
> The current implementation of Connection#isConnected() will always overwrite the authorization strategy in the client that it is using. This seems wrong given that #getResources, #createResource, #updateResource (and other methods) also set it but check if it already exists beforehand. Making sure that they dont overwrite an existing strategy.
> {code:title=Connection#isConnected}
> public boolean isConnected(IProgressMonitor monitor) {
> client.setAuthorizationStrategy(getAuthorizationStrategy());
> try {
> {code}
> {code:title=Connection#createResource}
> public <T extends IResource> T createResource(T resource) {
> try {
> if(client.getAuthorizationStrategy() == null) {
> client.setAuthorizationStrategy(getAuthorizationStrategy());
> }
> return client.create(resource);
> {code}
> A very likely side-effect of this is in Connection#ownsResource which compares clients (the one in the connection and the one attached to the given resource. The 2 clients are compared with the authorization strategy:
> {code:title=com.openshift.internal.restclient.DefaultClient#equals}
> @Override
> public boolean equals(Object obj) {
> ...
> return ObjectUtils.equals(strategy, other.strategy);
> {code}
> the lookup for a connection for a given resource in ConnectionRegistryUtils#safeGetConnectionFor will therefore fail after a Connection#isConnected:
> {code:title=ConnectionsRegistryUtil#safeGetConnectionFor(IResource)}
> public static Connection safeGetConnectionFor(IResource resource) {
> Collection<Connection> all = ConnectionsRegistrySingleton.getInstance().getAll(Connection.class);
> for (Connection connection : all) {
> if(connection.ownsResource(resource)) {
> return connection;
> }
> }
> return null;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 10 months