error to pass data from pentaho HTTP Client to Json Input - httpclient

I am trying to load json data from the following link http://swapi.co/api/films/
into pentaho.
I used 3 steps Generate Rows, HTTP Client and Json Input
Generate Rows Step :
Limit: 1
Name: movies
Type: string
Value:http://swapi.co/api/films/?format=json
HTTP Client Step:
General Tab
Accept URL from field? Yes
URL field name: movies
Result fieldname: json
fields Tab
Name: movies
Parameters: movies
Json Input Step:
(Fields Tab)
(would like to get all the fields in the "results" array eg. title,episode, director.....)
Name: title
Path: $.results[0]
Type: String
(fields Tab)
Name: movies
Parameters: movies
I get this error:
2016/02/24 12:05:00 - Json Input.0 - ERROR (version 4.4.0-stable, build 17588 from 2012-11-21 16.02.21 by buildguy) : at org.pentaho.di.trans.steps.jsoninput.JsonReader.readString(JsonReader.java:127)
2016/02/24 12:05:00 - Json Input.0 - ERROR (version 4.4.0-stable, build 17588 from 2012-11-21 16.02.21 by buildguy) : ... 7 more
2016/02/24 12:05:00 - Json Input.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)

That URL doesn't give pure json output. Try using http://swapi.co/api/films/?format=json instead.

It seems that swapi.co is using Cloudfare Browser Integrity Check, and it doesn't give a real response to Pentaho HTTP Client:
<div class="cf-wrapper cf-header cf-error-overview">
<h1>
<span class="cf-error-type" data-translate="error">Error</span>
<span class="cf-error-code">1010</span>
<small class="heading-ray-id">Ray ID: 279b7723caa3426d • 2016-02-24 13:20:00 UTC</small>
</h1>
<h2 class="cf-subheadline" data-translate="error_desc">Access denied</h2>
</div><!-- /.header -->
<div class="cf-column">
<h2 data-translate="what_happened">What happened?</h2>
<p>The owner of this website (swapi.co) has banned your access based on your browser's signature (279b7723caa3426d-ua31).</p>
</div>
Here is an example to use the JSON Input Step:

Related

How to use conditions in OpenAPI Generator's Mustache templates?

I'm using OAS3 generator for Java as a Maven plugin to generate POJOs, controllers, delegates etc for my APIs with the Mustache templates from the openapi-generator repository: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/JavaSpring/apiController.mustache
I'm trying to edit this template so that the "#Controller" annotation is generated only if a condition is met. I've searched for multiple solutions for this and one of them was using "vendorExtensions".
I've made the following contract with x-generateController vendorExtension:
openapi: 3.0.0
info:
title: User API
description: API for user changes
contact:
name: xxx
url: xxx
email: xxx
license:
name: xxx
url: xxx
version: 1.0.0
tags:
- name: user
x-generateController: True
paths:
/users:
...
And then in the Mustache template file I have put the following:
{{#vendorExtensions.x-generateController}}
#Controller("{{classname}}")
{{/vendorExtensions.x-generateController}}
The generator works just fine without this condition but it seems like it doesn't take into account x-generateController. In fact, if I try to just place it as a comment like this:
// {{vendorExtensions.x-generateController}}
I get only "// " and an empty space. I've also tried putting it at the "endpoint level" and not in the "info level" and the problem is the same.
Is there anything more that I should've done in the configuration? Is there any alternative for a condition in the Mustache template?

Custom rule for application/problem+json using Stoplight Spectral CLI

I'm trying to make a custom rule based on the unkown-error-format that can be found here here. Using this Open API document as an example:
openapi-generated.yaml
openapi: 3.0.3
info:
title: API
version: 1.0.0
servers:
- url: https://api.com/
paths:
/:
get:
tags: []
summary: Your GET endpoint
description: Your GET endpoint
operationId: get-endpoint
responses:
"500":
description: Error
content:
application/json:
schema:
properties:
errorDescription:
type: string
and this rule set:
.spectral.yml
extends:
- https://raw.githubusercontent.com/openapi-contrib/style-guides/master/apisyouwonthate.yml
rules:
unknown-error-format: error
When running
spectral lint --ruleset .spectral.yml openapi-generated.yaml
I was expecting an error to be returned, because the 500 response content is application/json and not one of the allowed values application/vnd.api+json, application/problem+xml, and application/problem+json.
Instead no errors are found:
No results with a severity of 'error' or higher found!
I experimented with some other Spectral core functions that should make the linter return an error, but it does not. I suspect the expression in given is not returning the right result, internally.
Additionally, I tried using this JSON Path Demo to check if the output array with "application/json" is returned for the path in the rule's given. It does.
Is there a problem with this rule or am I doing something wrong?
I'm using Spectral version 6.1.0.
Thanks in advance.

Is it possible to migrate only source and code history from Azure DevOps Server to Azure DevOps Service?

We are trying to migrate from TFS 2015 to Azure DevOps Service. We apparently have partial configurations of Work Item and Process Templates that will not pass TFSMigrator validation, and I'm searching for a way to skip all of that completely and only migrate source control and version history.
I've gone through multiple iterations on a development server and have a successful process down to upgrade from TFS 2015 to Azure DevOps Server 2019. Unfortunately the Migrator.exe tool still continues to fail, and as much as I've read up on the XML modifications that would be necessary, and we might be able to do to reapply and reconfigure the Work Items and Process Templates, I'm having difficulty getting the final pieces in place. It's all the more frustrating because we never actually used Work Items, Build Tools, Test Plans, etc. All we are interested in moving is our primary TFVC project's source code with version history, and for now I'd be entirely happy to use the new "Basic" Work Item process in the Azure DevOps Service.
Here are some of the problems we're seeing in the DataMigrationTool.log if someone has other ideas, but I'm mostly interested in skipping the need to fix all of this entirely...
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: TF402571: Required element FeedbackRequestWorkItems is missing from Process Configuration.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: TF402571: Required element FeedbackResponseWorkItems is missing from Process Configuration.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: TF402574: ProcessConfiguration doesn't specify required TypeField Team.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: TF402574: ProcessConfiguration doesn't specify required TypeField RemainingWork.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: TF402574: ProcessConfiguration doesn't specify required TypeField Order.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: TF402574: ProcessConfiguration doesn't specify required TypeField Effort.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: TF402574: ProcessConfiguration doesn't specify required TypeField Activity.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: TF402574: ProcessConfiguration doesn't specify required TypeField ApplicationStartInformation.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: TF402574: ProcessConfiguration doesn't specify required TypeField ApplicationLaunchInstructions.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: TF402574: ProcessConfiguration doesn't specify required TypeField ApplicationType.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\TypeDefinitions\Feature.xml:: TF26177: The field System.IterationId cannot be renamed from 'IterationID' to 'Iteration ID'.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\TypeDefinitions\SharedParameter.xml:: TF26177: The field System.IterationId cannot be renamed from 'IterationID' to 'Iteration ID'.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: The following element contains an error: TypeFields. TF400526: Element is missing. The XML is not valid.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: The following element contains an error: RequirementBacklog. TF401107: The attribute 'category' is missing from the element.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: The following element contains an error: RequirementBacklog. TF401107: The attribute 'pluralName' is missing from the element.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: The following element contains an error: RequirementBacklog/States. TF400526: Element is missing. The XML is not valid.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: The following element contains an error: RequirementBacklog/Columns. TF400508: No columns are defined. You must define at least one column.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: The following element contains an error: RequirementBacklog/AddPanel. TF400526: Element is missing. The XML is not valid.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: The following element contains an error: TaskBacklog. TF401107: The attribute 'category' is missing from the element.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: The following element contains an error: TaskBacklog/States. TF400526: Element is missing. The XML is not valid.
[Error #14:22:24.568] Step : ProcessValidation - Failure Type - Validation failed : Invalid process template: WorkItem Tracking\Process\ProcessConfiguration.xml:: The following element contains an error: TaskBacklog/Columns. TF400508: No columns are defined. You must define at least one column.
Edit: Thanks to Daniel Mann's comments and after reviewing some of the other options around git-tf (which does seem to have stopped development btw, for anyone else searching) it looks like fixing the process templates and work item issues will be the only workable solution for us because we need to try to retain user check-in history as well. It seems that an improved solution here would be if Microsoft could extend the TFSMigration/Migrator programs to allow users to do a "Repo Only" code and version migration and bypass work item and process template historical data. I'll try to share my experiences working through the Migrator logs if I'm able to get it working (and explain it coherently!)

Jekyll and Strapi: Liquid Exception: Please make sure Strapi Server is correctly running

I am currently trying to follow this tutorial (https://blog.strapi.io/building-a-static-website-using-jekyll-and-strapi/) and everything was working fine until the "Posts List" step. Once I added the _layouts/home.html file and restarted the jekyll server (bundle exec jekyll serve), I ended up with an error message:
Liquid Exception: The Strapi server sent a error with the following status: 404. Please make sure it is correctly running. in /_layouts/home.html
jekyll 3.8.5 | Error: The Strapi server sent a error with the following status: 404. Please make sure it is correctly running.
Thing is, the strapi server IS RUNNING... I have access to the the strapi admin backend and I can access and view the Posts json object by visiting: http://localhost:1337/posts.
I'm not actually too sure what is going on and how I can fix this. Documentation doesn't help nor can I seem to find anything on this issue in google or stack overflow.
Anyone else got this issue?
Here is the content of home.html:
---
layout: default
---
<div class="home">
<h1 class="page-heading">Posts</h1>
{%- if strapi.collections.posts.size > 0 -%}
<ul class="post-list">
{%- for post in strapi.collections.posts -%}
<li>
<span class="post-meta">{{ post.createdAt | date_to_string }} by {{ post.author.username }}</span>
<h3>
<a class="post-link" href="{{ post.url | relative_url }}">
{{ post.title }}
</a>
</h3>
<!-- Display an excerpt of the article -->
<p>{{ post.content | markdownify | strip_html | truncatewords: 10 }}</p>
</li>
{%- endfor -%}
</ul>
{%- endif -%}
</div>
EDIT: added Endpoint Config
strapi:
# Your API endpoint (optional, default to http://localhost:1337)
endpoint: http://localhost:1337
# Collections, key is used to access in the strapi.collections
# template variable
collections:
# Example for a "posts" collection
posts:
# Collection name (optional). Used to construct the url requested. Example: type `foo` would generate the following url `http://localhost:1337/foo`.
type: post
# Permalink used to generate the output files (eg. /posts/:id).
permalink: /posts/:slug/
Finally got it working... I ended up updating jekyll-strapi to lastest version 0.1.2, and jekyll to version 3.8.5.
I already had the gem jekyll-strapi installed, so to update it, I did in a Terminal:
gem install jekyll-strapi
This ensure that you have the newest latest version with bug fixes.
Next, your gemfile should be configured like this:
gem "jekyll", "~> 3.8.5"
[...]
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
gem 'jekyll-strapi', github: 'strapi/jekyll-strapi'
end
The "github: 'strapi/jekyll-strapi'" parameter will make sure you have the latest fix for the infamous bug: "Liquid Exception: Can't convert Integer into String"
One more thing, in blog/_config.yml, instead of "type: post"
strapi:
collections:
posts:
type: post
YOU NEED TO make 'post' plural. So, you will end up with:
strapi:
collections:
posts:
type: posts
If you don't you will end up with this error: "Liquid Exception: The Strapi server sent a error with the following status: 404. Please make sure it is correctly running. in /_layouts/home.html"
I hope it helps someone else struggling with this tutorial. With gems and frameworks moving and updating fast, some online tutorial become dated and out of synch with the latest builds.

Unable to add user properties in LDAP Server using Apache Directory Studio on my eclipse using LDAP browser

I have configured LDAP Server From Apache Directory Studio on my eclipse. I have created user and set the password as well.
Now I have to add the user properties and their values from eclipse- LDAP Browser like userName,userFaxNumber,userPhoneNo,userDesignation....
Please find the attached step:
while trying to add it I am getting below error:
Error while executing LDIF - [LDAP: error code 16 - NO_SUCH_ATTRIBUTE:
failed for MessageType : MODIFY_REQUES java.lang.Exception:
[LDAP:
error code 16 - NO_SUCH_ATTRIBUTE: failed for
MessageType : MODIFY_REQUEST Message ID : 20 Modify Request Object :
'uid=user1,ou=system' Modification[0] Operation : add Modification
userFaxNumber:
222222org.apache.directory.api.ldap.model.message.ModifyRequestImpl#a224a2db:
ERR_04269 ATTRIBUTE_TYPE for OID userfaxnumber does not exist!] at
org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.checkResponse(DirectoryApiConnectionWrapper.java:1374)
at
org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.access$9(DirectoryApiConnectionWrapper.java:1342)
at
org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper$4.run(DirectoryApiConnectionWrapper.java:736)
at
org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.runAndMonitor(DirectoryApiConnectionWrapper.java:1269)
at
org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.checkConnectionAndRunAndMonitor(DirectoryApiConnectionWrapper.java:1205)
at
org.apache.directory.studio.connection.core.io.api.DirectoryApiConnectionWrapper.modifyEntry(DirectoryApiConnectionWrapper.java:758)
at
org.apache.directory.studio.ldapbrowser.core.jobs.ImportLdifRunnable.importLdifRecord(ImportLdifRunnable.java:515)
at
org.apache.directory.studio.ldapbrowser.core.jobs.ImportLdifRunnable.importLdif(ImportLdifRunnable.java:272)
at
org.apache.directory.studio.ldapbrowser.core.jobs.ExecuteLdifRunnable.executeLdif(ExecuteLdifRunnable.java:157)
at
org.apache.directory.studio.ldapbrowser.core.jobs.ExecuteLdifRunnable.run(ExecuteLdifRunnable.java:123)
at
org.apache.directory.studio.ldapbrowser.core.jobs.UpdateEntryRunnable.run(UpdateEntryRunnable.java:59)
at
org.apache.directory.studio.connection.ui.RunnableContextRunner$1.run(RunnableContextRunner.java:116)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
[LDAP: error code 16 - NO_SUCH_ATTRIBUTE: failed for MessageType :
MODIFY_REQUEST Message ID : 20 Modify Request Object :
'uid=gridcomm22,ou=system' Modification[0] Operation : add
Modification rlSubmitterFaxNumber:
222222org.apache.directory.api.ldap.model.message.ModifyRequestImpl#a224a2db:
ERR_04269 ATTRIBUTE_TYPE for OID userfaxnumber does not exist!]
Please help.. Thanks in advance..