From 404f753beb2b312c67023c5f7d735ca6e8d405c8 Mon Sep 17 00:00:00 2001 From: EnriqueGomez12 Date: Thu, 5 Sep 2024 17:36:25 +0200 Subject: [PATCH] CHANGELOG added --- CHANGELOG.md | 26 +++++++++++++++++++ .../dosonarapi/plugin/OpenApiAnalyzer.java | 2 -- .../plugin/OpenApiScannerSensor.java | 11 +++----- 3 files changed, 29 insertions(+), 10 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..b45921b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,26 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [1.1.1] - 2024-06-01 + +## Added + +### Now, support for OpenAPI 3.1 is included. These are some of the new changes: + +- Introduces support for webhooks, allowing you to describe asynchronous notifications that your API can send to users' systems. +- Replaces the nullable keyword with type arrays, aligning with JSON Schema by allowing multiple types in the type keyword. +- ExclusiveMinimum and ExclusiveMaximum now take distinct values instead of boolean, simplifying their use. +- Replace example with examples inside schema objects, allowing multiple examples in a YAML array format, aligning with JSON Schema. +- Binary file uploads in POST requests no longer require a schema definition, simplifying the process. +- For base64 encoded file uploads, OpenAPI 3.1 uses contentEncoding to specify the encoding. +- For multipart file uploads with binary files, OpenAPI 3.1 uses contentMediaType to specify the media type. +- The $schema keyword is now allowed in OpenAPI 3.1, enabling the definition of the JSON Schema dialect a model uses, which can be different drafts or custom dialects. +- Introduces support for mutual TLS (mTLS), providing two-way authentication between the client and server for enhanced security. +- General improvements in the alignment and clarity of the specification, including enhancements to OAuth 2.0 support. +- Added support for the identifier keyword in the License Object, allowing the definition of an SPDX license expression for the API. +- Added compatibility with the dosonarapi plugin(now, renamed to SonarOpenAPI-Rules), which now provides many rule definitions for OpenAPI 3.1 + diff --git a/sonar-openapi-plugin/src/main/java/org/apiaddicts/apitools/dosonarapi/plugin/OpenApiAnalyzer.java b/sonar-openapi-plugin/src/main/java/org/apiaddicts/apitools/dosonarapi/plugin/OpenApiAnalyzer.java index f98e531..5eb1ea4 100644 --- a/sonar-openapi-plugin/src/main/java/org/apiaddicts/apitools/dosonarapi/plugin/OpenApiAnalyzer.java +++ b/sonar-openapi-plugin/src/main/java/org/apiaddicts/apitools/dosonarapi/plugin/OpenApiAnalyzer.java @@ -20,12 +20,10 @@ package org.apiaddicts.apitools.dosonarapi.plugin; import com.sonar.sslr.api.RecognitionException; - import java.io.IOException; import java.util.Collections; import java.util.List; import java.util.Set; - import org.apiaddicts.apitools.dosonarapi.openapi.OpenApiConfiguration; import org.apiaddicts.apitools.dosonarapi.plugin.cpd.OpenApiCpdAnalyzer; import org.sonar.api.batch.fs.InputFile; diff --git a/sonar-openapi-plugin/src/main/java/org/apiaddicts/apitools/dosonarapi/plugin/OpenApiScannerSensor.java b/sonar-openapi-plugin/src/main/java/org/apiaddicts/apitools/dosonarapi/plugin/OpenApiScannerSensor.java index 54a401f..a6b29f3 100644 --- a/sonar-openapi-plugin/src/main/java/org/apiaddicts/apitools/dosonarapi/plugin/OpenApiScannerSensor.java +++ b/sonar-openapi-plugin/src/main/java/org/apiaddicts/apitools/dosonarapi/plugin/OpenApiScannerSensor.java @@ -47,7 +47,6 @@ public OpenApiScannerSensor(CheckFactory checkFactory, FileLinesContextFactory f } public OpenApiScannerSensor(CheckFactory checkFactory, FileLinesContextFactory fileLinesContextFactory, NoSonarFilter noSonarFilter, @Nullable OpenApiCustomRuleRepository[] customRuleRepositories) { - // customRulesRepositories is injected by the context, if present this.checks = OpenApiChecks.createOpenApiCheck(checkFactory) .addChecks(CheckList.REPOSITORY_KEY, CheckList.getChecks()) .addCustomChecks(customRuleRepositories); @@ -65,18 +64,14 @@ public void describe(SensorDescriptor descriptor) { @Override public void execute(SensorContext context) { FilePredicates p = context.fileSystem().predicates(); - //OpenApiProperties openApiProperties = new OpenApiProperties(); - - //scanFiles(context, p, openApiProperties.getV2FilesPattern(context), true); - //scanFiles(context, p, openApiProperties.getV3FilesPattern(context), false); scanFiles(context, p); } - public void scanFiles(SensorContext context, FilePredicates p/*, String[] pathPatterns, boolean isV2*/) { + public void scanFiles(SensorContext context, FilePredicates p) { Iterable it = context.fileSystem().inputFiles( p.and(p.hasType(InputFile.Type.MAIN), - p.hasLanguage(OpenApi.KEY)/*, - p.matchesPathPatterns(pathPatterns)*/)); + p.hasLanguage(OpenApi.KEY) + )); List list = new ArrayList<>(); it.forEach(list::add); List inputFiles = Collections.unmodifiableList(list);