how to show the results of yml file in visual studio code - visual-studio-code

i am learning SWAGGER and Openapi. i downloaded the necessary plugins in visual studio code.
i added the below posted code to test.yml. how to see the results or the output of the code mentioned below.??
i just run the code in visual studio code but nothing appears
please let me know how to show the results of the code posted below.
code:
openapi: '3.0.2'
info:
title: Get distance providing start and end GPS coordinates.
version: '1.0'
servers:
- url: https://api.server.test/v1
paths:
/test:
get:
responses:
'200':
description: OK

Related

Problem of Xtend result on RCP eclipse 2022-03

I'm coding a plugin to generate a code using xtend (model to text langage).
The code is working on my dev env but it is not the case on my RCP.
here is an example of the generated code on my dev env :
paths: /TempService/getTemp: post: operationId: getTempUsingpost parameters: - name: newParam in: query required: false schema:
and this is the genrated code on my rcp :
paths:
?FOR attribute : clazz.attributes? ?IF attribute instanceof Port? ?IF attribute.isConjugated? ?val classifier = attribute.type? ?OpenAPIPaths.generatePath(classifier)? ?ENDIF? ?ENDIF?
The problem appeared when I migrated to eclipse 2022-03 (from 2021-09).

Visual Code Studio, File Import Callback not Supported - File Source not Found

While trying to troubleshoot another issue with my project, I must've broken something along the way, but I have no idea how to fix this.
These are my import statements for the project:
pragma solidity >=0.6.6;
import "#openzeppelin/contracts/token/ERC721/ERC721.sol";
import "#chainlink/contracts/src/v0.6/VRFConsumerBase.sol";
And this is my brownie-config.yaml
depencencies:
- OpenZeppelin/openzeppelin-contracts#3.4.0
- smartcontractkit/chainlink-brownie-contracts#1.0.2
compiler:
solc:
remappings:
- '#openzeppelin=OpenZeppelin/openzeppelin-contracts#3.4.0'
- '#chainlink=smartcontractkit/chainlink-brownie-contracts#1.0.2'
But despite all this working until yesterday, trying to compile only gives me these errors:
PS C:\Users\XXX\Desktop\Project> brownie compile
INFO: Could not find files for the given pattern(s).
Brownie v1.16.4 - Python development framework for Ethereum
New compatible solc version available: 0.6.6
Compiling contracts...
Solc version: 0.6.6
Optimizer: Enabled Runs: 200
EVM Version: Istanbul
CompilerError: solc returned the following errors:
contracts/AdvancedCollectible.sol:3:1: ParserError: Source "OpenZeppelin/openzeppelin-contracts#3.4.0/contracts/token/ERC721/ERC721.sol" not found: File not found.
import "#openzeppelin/contracts/token/ERC721/ERC721.sol";
^-------------------------------------------------------^
contracts/AdvancedCollectible.sol:4:1: ParserError: Source "smartcontractkit/chainlink-brownie-contracts#1.0.2/contracts/src/v0.6/VRFConsumerBase.sol" not found: File not found.
import "#chainlink/contracts/src/v0.6/VRFConsumerBase.sol";
^---------------------------------------------------------^
How do I solve this?
I've seen some answers to similar issues referencing node.js or local copies of the stuff I'm trying to import, but isn't this command supposed to pull stuff off github?
Why is it failing to do so out of nowhere?
Install Openzeppelin at the root of your folder by using npm
npm i #openzeppelin/contracts
same thing for Chainlink
This is because the solidity extension is looking in the wrong directory.
Below step fixed the issue for me -
Change the settings in Solidity extension in VSCode.
The default settings include: "solidity.packageDefaultDependenciesContractsDirectory": "contracts" Users need to change the setting from contracts to an empty string. "solidity.packageDefaultDependenciesContractsDirectory": ""
Source - https://github.com/juanfranblanco/vscode-solidity/issues/178

SonarLint connected mode is not working in VS code

I have Sonar Lint version as 1.15.0 and Vs Code version as 1.43.I have given the server setting as
"sonarlint.connectedMode.connections.sonarqube": [
{
"serverUrl":"xx",//Server url
"token": "xx"//Token generated from SonarQube
}
],
This configuration is given in the user setting of Vscode.
In the work space setting.json have given the following code,
sonarlint.connectedMode.project": {
"connectionId": "mySonar",
"projectKey": "my-dream-app"
}
The problem is Sonar Lint is not getting connected with the Sonarqube server.Could any one help me out why this configuration is not working .

mulesoft: ERROR: ramlParser: loadPath: loadApi: content/[object Object]: no such path

I am using API Editor in Mulesoft and I am getting following error
ramlParser: loadPath: loadApi: content/[object Object}: no such path
It seems to be related to inclusions of libraries in main RAML such as:
uses:
myLibrary: !include libraries/myLibraryFile.raml
The libraries exist but still I am getting that error. Only if I remove the include the error goes.
Have any of you got same problem? How did you solve it?
Thanks folks!
When using "uses:" you don't have to put "!include" only the name of the library and the path (without "!include").
See
RAML- !include strange behavior
for a more detailed answer

How to debug typescript jasmine tests in visual studio?

I have typescript code and typescript jasmine tests running within Karma. I can run the tests from the command-line (using Karma), and also run the tests from the ReSharper test runner. Presumably I could also run the tests using Karma Test Adapter VS extension or VS Adapter for Karma. So, lots of options for running the tests.
My question is: How do I debug the tests, in the VS debugger?
I was able to get Visual Studio debugging of typescript jasmine tests, running in Karma, working. Wow, that's a mouthful.
Here's how I did it:
In IE, Options, Advanced: Clear the "Disable script debugging (Internet Explorer)" checkbox.
Install the node modules (globally) required to run karma - if you haven't already:
npm install -g karma karma-chrome-launcher karma-ie-launcher jasmine-core karma-jasmine karma-jasmine-html-reporter
npm install -g phantomjs karma-phantomjs-launcher
In the karma.conf.js, add support for serving the required sourcemap and typescript files. Here's mine:
module.exports = function(config) {
config.set({
frameworks: ['jasmine'],
files: [
'bower_components/angular/angular.js',
'bower_components/angular-mocks/angular-mocks.js',
'dist/**/*.js',
'test/out/**/*.js',
// Key addition to support debugging typescript tests
// Enable serving (but don't include as scripts) sourcemap and typescript files
{pattern: '**/*.js.map', included: false},
{pattern: '**/*.ts', included: false}
],
reporters: ['html', 'progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['PhantomJS']
});
}
After compiling your typescript, run karma, launching IE:
karma start --browsers=IE --reporters=html
In Visual Studio, Debug menu | Attach to Process... , then choose the iexplore.exe instance(s) that look right - eg the title may match the Karma web page title ("Karma DEBUG RUNNER" currently), and the process Type must be "Script". If typescript debugging doesn't work, try adding multiple iexplore.exe instances, including all the probably Script instances.
After that, you should see a "Script Documents" folder in Solution Explorer, and you should be able to put breakpoints in your typescript, run the tests in your browser, and step through your typescript code.
It turns out that all these steps also work for debugging Typescript tests and code in Chrome - just change step 4 to:
karma start --browsers=Chrome --reporters=html
(skip step 5) then open Chrome developer tools to debug the typescript in chrome.