Skip to content

sonaropenapi-rules is a set of rules to validate OpenAPI / Swagger api definitions in SonarQube, you also need to install the evaluation engine.

License

Notifications You must be signed in to change notification settings

apiaddicts/sonaropenapi-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

πŸ› οΈ sonaropenapi-rules Release Java License: LGPL v3

This repository contains a set of custom SonarQube rules specifically designed to analyze and improve the quality of OpenAPI specifications. By integrating these rules, teams can ensure best practices, maintainability, and consistency in their API definitions.

This repository is intended for :octocat: community use, it can be modified and adapted without commercial use. If you need a version, support or help for your enterprise or project, please contact us πŸ“§ [email protected]

πŸ’‘ If you have an idea for a rule but you are not sure that everyone needs it you can implement a custom rule available only for you.

Twitter Discord LinkedIn Facebook YouTube

πŸ™Œ Join the doSonarApi Adopters list

πŸ“’ If doSonarApi is part of your organization's toolkit, we kindly encourage you to include your company's name in our Adopters list. πŸ™ This not only significantly boosts the project's visibility and reputation but also represents a small yet impactful way to give back to the project.

Organization Description of Use / Referenc
CloudAppi Apification and generation of microservices
Madrid Digital Generation of microservices
Apiquality Generation of microservices

πŸ‘©πŸ½β€πŸ’» Contribute to ApiAddicts

We're an inclusive and open community, welcoming you to join our effort to enhance ApiAddicts, and we're excited to prioritize tasks based on community input, inviting you to review and collaborate through our GitHub issue tracker.

Feel free to drop by and greet us on our GitHub discussion or Discord chat. You can also show your support by giving us some GitHub stars ⭐️, or by following us on Twitter, LinkedIn, and subscribing to our YouTube channel! πŸš€

"Buy Me A Coffee"

πŸ“‘ Getting started

πŸ” Configure scanner

Maven plugin

Configure properties

In pom.xml configure:

    <properties>
        <!-- Optional, When is set only the language specified is analyzed -->
        <sonar.language>openapi</sonar.language>
        <!-- Optional, Default value is src/main,pom.xml -->
        <sonar.sources>.</sonar.sources>
    </properties>

Run scanner

mvn sonar:sonar -Dsonar.host.url=<HOST> -Dsonar.login=<KEY>

External sonar-scanner

Install sonar-scanner

Download the sonar-scanner from https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/ and make it accessible.

Configure properties

In sonar-project.properties (file in root project folder) configure:

# must be unique in a given SonarQube instance
sonar.projectKey=test:test
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
sonar.projectName=OpenAPI plugin tests
sonar.projectVersion=1.0-SNAPSHOT

# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# This property is optional if sonar.modules is set.
sonar.sources=.

# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
# Select the language to use for analysis
sonar.language=openapi

▢️ Run scanner

sonar-scanner -Dsonar.host.url=<HOST> -Dsonar.login=<KEY>

βœ… Compatibility

This plugin is supported by SonarQube versions greater or equal to 6.7.4

Explicit compatibility versions tested

Version
6.7.4
7.9-community
8.3-community

πŸ’› Sponsors

cloudappi

md

About

sonaropenapi-rules is a set of rules to validate OpenAPI / Swagger api definitions in SonarQube, you also need to install the evaluation engine.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published