Unable to parse Open API, or Google Service Configuration specification from openapiapp.yaml - google-app-engine

I try to follow exactly [this tutorial] (https://cloud.google.com/community/tutorials/exposing-aspnet-webapi-using-dotnetcore-with-cloud-endpoints ), but I get the following error at trying gcloud endpoints services deploy openapi.yaml :
ERROR: (gcloud.endpoints.services.deploy) Unable to parse Open API, or Google Service Configuration specification from [SampleSolution]
The body of openapi.yaml :
openapi: 3.0.1
info:
title: Notes API
version: v1
host: [google cloud project ID].appspot.com
paths:
/WeatherForecast:
get:
tags:
- WeatherForecast
responses:
'200':
description: Success
content:
text/plain:
schema:
type: array
items:
$ref: '#/components/schemas/WeatherForecast'
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/WeatherForecast'
text/json:
schema:
type: array
items:
$ref: '#/components/schemas/WeatherForecast'
components:
schemas:
WeatherForecast:
type: object
properties:
date:
type: string
format: date-time
temperatureC:
type: integer
format: int32
temperatureF:
type: integer
format: int32
readOnly: true
summary:
type: string
nullable: true
additionalProperties: false

I only see two things there:
openapi: 3.0.1. This should be swagger: "2.0" accordint ot the Basic structure of an OpenAPI document
host: [google cloud project ID].appspot.com. This should contain the proper project Id.
UPDATE
After checking the composition of your file and the Endpoints openAPI Docs:
OpenAPI feature limitations:
Currently, Cloud Endpoints accepts only version 2 of the OpenAPI Specification.
The Components Section in the Swagger docs mentions that applies to openAPI3. This is not compatible with point 1.
I suggest to remake your file following The basic structure of an OpenAPI document

Swashbuckle.AspNetCore now supports OpenApi 3, but it also has backwards compatibility with Swagger v2, by setting it up in Configure method (Startup class) with:
app.UseSwagger(c =>
{
c.SerializeAsV2 = true;
});

Related

Yaml Based Kamelet - Azure Blob Source Kafka Connectors - How to bind BlobServiceClient

I am trying to do authentication using serviceClient (SAS Token) instead of using accesskey. Following is my kamelet.yaml file config,
from:
uri: "quartz:azure-storage-blob-stream"
parameters:
cron: "{{cron}}"
steps:
- to:
uri: "azure-storage-blob:{{accountName}}/{{containerName}}"
parameters:
operation: "listBlobs"
serviceClient: "#registerBlobClient"
Whiled deploying application I am getting below error,
Caused by: org.apache.camel.PropertyBindingException: Error binding property (serviceClient=registerBlobClient-3) with name: serviceClient on bean: azure-storage-blob://*****/?operation=listBlobs&serviceClient=%23registerBlobClient with value: registerBlobClient

How can I validate an XML with String arrays using a RAML DataType?

I'm having an issue where a simple string array or integer array creates a warning and prevents the validation of XMLs within my RAML API specification in Anypoint Platform.
These are the files I'm currently using:
customerNames.raml:
#%RAML 1.0 DataType
displayName: customerNames
description: Full detail view on a customerNames array
additionalProperties: false
properties:
customerName:
type: array
items: string
customerNames.xml:
<?xml version="1.0" encoding="UTF-8"?>
<customerNames>
<customerName>John Doe</customerName>
<customerName>Jane Doe</customerName>
</customerNames>
Validation results in the following warning:
validation error
I've tried other notations as well:
#%RAML 1.0 DataType
displayName: customerNames
description: Full detail view on a customerNames array
additionalProperties: false
properties:
customerName:
type: string[]
But to no avail.
When I try to recreate this issue using JSON files, both notations do not yield the warning and validation can happen as expected.
Is this an Anypoint Platform bug or is my syntax incorrect?

Model form-data body request using Swagger 2.0 in yaml file

I am using swagger 2.0 and I have an endpoint which is using form-data as the payload for the request, I am using the same form-data body request in several places and I don't want to write it again and again (duplicate it) and I don't know how to model it inside my yaml file (I do know how to model object when it is part of the request body as payload).
This is the form-data payload I am trying to model:
I looked at swagger's documentation: https://swagger.io/docs/specification/2-0/file-upload/
and tried to do the same but I got errors as follow:
I don't want to duplicate the same values (if I do so it will work but the solution won't be elegant).
In OpenAPI 2.0, you can only reuse the definitions of individual form fields/parameters. There's no way to reuse a set of fields/parameters.
swagger: '2.0'
parameters:
name:
in: formData
name: name
type: string
upfile1:
in: formData
name: upfile1
type: file
...
paths:
/foo:
post:
consumes:
- multipart/form-data
parameters:
- $ref: '#/parameters/name'
- $ref: '#/parameters/upfile1'
- ...
/bar:
post:
consumes:
- multipart/form-data
parameters:
- $ref: '#/parameters/name'
- $ref: '#/parameters/upfile1'
- ...
To reuse the entire request body definition, you need OpenAPI 3.0. In OAS 3, request bodies can be defined in the global components/requestBodies section and referenced using $ref:
openapi: 3.0.0
paths:
/foo:
post:
requestBody:
$ref: '#/components/requestBodies/statusMode'
responses:
...
/bar:
post:
requestBody:
$ref: '#/components/requestBodies/statusMode'
responses:
...
components:
requestBodies:
statusMode:
required: true
content:
multipart/form-data:
schema:
type: object
# The properties correspond to individual form fields
properties:
name:
type: string
upfile1:
type: string
format: binary

How set up speaking links for solr in TYPO3 9

Is it possible to setup speaking urls in TYPO3 9 for EXT:tx_solr as it was with RealUrl in prev versions?
I've looked at the example of EXT: news and tried to implement the EXT: solr search, but I do not succeed. I tried that:
routeEnhancers:
SearchPlugin:
type: Extbase
limitToPages:
# Suche list view - needed for pagination:
- 36
extension: Solr
plugin: Pi_Search
routes:
- { routePath: '/page/{page}', _controller: 'Search::search', _arguments: {'page': '#widget_0/currentPage'} }
- { routePath: '/list/{page}', _controller: 'News::list', _arguments: {'page': '#widget_0/currentPage'} }
- { routePath: '/tag/{tag_name}', _controller: 'News::list', _arguments: {'tag_name': 'overwriteDemand/tags'}}
- { routePath: '/blog/{news_title}', _controller: 'News::detail', _arguments: {'news_title': 'news'} }
- { routePath: '/archive/{year}/{month}', _controller: 'News::archive' }
defaultController: 'Search::search'
defaults:
page: '0'
requirements:
page: '\d+'
aspects:
page:
type: StaticRangeMapper
start: '1'
end: '100'
EXT:realurl isn't compatible to TYPO3 9.5. Instead with TYPO3 9.5 a new feature called "routing" was established in TYPO3.
You need to add a site configuration to your installation. This can be done via the backend module "Sites".
Afterwards, speaking URLs will work right out of the box for regular pages. If you have any extension installed, you need to add routeEnhancers to your site config.
Documentation:
Site Handling
Page based Routing
Example for routeEnhancers with EXT:news

swagger editor does not generate correct request for file upload

I am using Swagger editor to build a post request to upload a file. My swagger json file is defined as follows.
swagger: '2.0'
info:
version: 0.0.0
title: '<enter your title>'
host: 'localhost:11235'
paths:
/form/upload:
post:
description: |
Post files.
consumes:
- multipart/form-data
produces:
- application/octet-stream
parameters:
- name: file
in: formData
description: upload file
required: true
type: file
- name: text
description: additional info
in: formData
type: string
responses:
'200':
description: Successful response
schema:
type: file
Then on the right side of the editor. I click the Try this operation. I select a file. The constructed request looks like this.
POST http://localhost:11235/form/upload HTTP/1.1
....
Content-Length: 40
Content-Type: multipart/form-data
file: C:\fakepath\swagger.json
text: 123
The file content is not transferred in the request. Only the file name is written into the request. Is this because swagger editor does not support file upload or my swagger json is wrong? Could anyone kindly help me with this? Thanks.
There is still an open issue for swagger-editor:
https://github.com/swagger-api/swagger-editor/issues/599
as reported it has been fixed in swagger-api:
https://github.com/swagger-api/swagger-ui/issues/838
Use swagger-ui for file uploading, it is working:
- in: formData
name: document
description: Documento Fiscal
required: true
type: file

Resources