Skip to content

Commit

Permalink
CHANGELOG added
Browse files Browse the repository at this point in the history
  • Loading branch information
EnriqueGomez12 committed Sep 5, 2024
1 parent 346cdc7 commit 404f753
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<InputFile> it = context.fileSystem().inputFiles(
p.and(p.hasType(InputFile.Type.MAIN),
p.hasLanguage(OpenApi.KEY)/*,
p.matchesPathPatterns(pathPatterns)*/));
p.hasLanguage(OpenApi.KEY)
));
List<InputFile> list = new ArrayList<>();
it.forEach(list::add);
List<InputFile> inputFiles = Collections.unmodifiableList(list);
Expand Down

0 comments on commit 404f753

Please sign in to comment.