swagger-api / swagger-api/swagger-parser

Request for a Simplified Swagger Parser with Minimal Dependencies

Open
#2,148 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
867
Forks
560
Avg merge
2d 21h
Merged PRs (30d)
7

Description

Issue Description:

Dear Team,

I am using the Swagger parser, and while its functionality is appreciated, the sheer number of dependencies introduced by the library is problematic. Below are my observations and concerns:

  1. Excessive Dependencies: The library adds over 50 additional dependencies to my project. Some examples:
  • org.slf4j: Not necessary for a simple parser. It clutters logs with irrelevant prompts for adding more dependencies.
  • com.github.java-json-tools: This library appears to be inactive.
  • com.sun.activation.jakarta and jakarta.xml.bind: Outdated and unreliable with newer Java versions, especially in stricter environments.
  • org.mozilla:rhino: JavaScript? What?
  • apache.httpclient: The use case here is unclear.
  • com.google.guava, org.apache.commons:commons-lang3, commons-io: Why are these required for basic parsing?
  1. Core Simplicity Missing: For a YAML/JSON parser, dependencies like SnakeYAML and ObjectMapper are understandable, but even these come with their own CVE risks. However, the other dependencies seem unnecessary for the core functionality.
  2. Reflections and Overhead: The library’s reliance on reflection further complicates its use and limits performance optimization.

Proposal:

  • Simplify the Library: Rebuild the parser using plain Java, focusing on minimalism. Most parsing tasks can be achieved without additional libraries.
  • Reduce Dependencies: Restrict dependencies to absolute essentials like SnakeYAML and ObjectMapper, provided their risks are mitigated.
  • Modernize: Remove outdated or dead dependencies like com.github.java-json-tools.
  • Avoid Reflection: Replace reflective mechanisms with straightforward, efficient alternatives.

This library has great potential but could be significantly better with these improvements. My goal is not to replace it, but to help make it a cleaner, more reliable tool for everyone.

Looking forward to your thoughts and potential roadmap for addressing these issues.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by auditing the project's dependency graph and parser components; implementation would require an agreed scope for dependency removal, reflection changes, and modernization before completion can be measured.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.