JSONGenerator for addons and docs.json improvements#8116
Merged
Efnilite merged 16 commits intodev/featurefrom Sep 17, 2025
Merged
JSONGenerator for addons and docs.json improvements#8116Efnilite merged 16 commits intodev/featurefrom
docs.json improvements#8116Efnilite merged 16 commits intodev/featurefrom
Conversation
docs.json improvementsdocs.json improvements
Burbulinis
approved these changes
Aug 10, 2025
sovdeeth
requested changes
Aug 20, 2025
sovdeeth
reviewed
Aug 21, 2025
sovdeeth
approved these changes
Aug 21, 2025
APickledWalrus
requested changes
Aug 21, 2025
Member
APickledWalrus
left a comment
There was a problem hiding this comment.
Looking really good, just a few things
APickledWalrus
approved these changes
Aug 24, 2025
Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
erenkarakal
pushed a commit
to erenkarakal/Skript
that referenced
this pull request
Nov 26, 2025
* init commit * add docs * add StructEvent docs * requested changes * fix default values for DocumentationGenerator * github why won't you work * attempt to fix getting skript version in generate-docs action * attempt to fix getting skript version in generate-docs action * requested changes * requested changes * requested changes * thx bbg burb * Update src/main/java/ch/njol/skript/doc/JSONGenerator.java Co-authored-by: Patrick Miller <apickledwalrus@icloud.com> --------- Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
erenkarakal
pushed a commit
to erenkarakal/Skript
that referenced
this pull request
Nov 26, 2025
* init commit * add docs * add StructEvent docs * requested changes * fix default values for DocumentationGenerator * github why won't you work * attempt to fix getting skript version in generate-docs action * attempt to fix getting skript version in generate-docs action * requested changes * requested changes * requested changes * thx bbg burb * Update src/main/java/ch/njol/skript/doc/JSONGenerator.java Co-authored-by: Patrick Miller <apickledwalrus@icloud.com> --------- Co-authored-by: Patrick Miller <apickledwalrus@icloud.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
docs.jsoncan only be generated for Skript.docs.json.@Eventsannotation do not follow thedocs.jsonspec.Solution
The `docs.json` can only be generated for Skript.
JSONGenerator has been modified to allow creating an instance of JSONGenerator based on a SkriptAddon instance. To this extent, the `skriptVersion` property has been replaced with the `source` property.JSONGenerator also now uses the new Registration API to get all syntax registered by a specific addon.
Because this makes JSONGenerator not follow the DocumentationGenerator pattern, and since HTMLGenerator will soon be obselete, DocumentationGenerator has been deprecated, alongside
JSONGenerator#generate().The return types of expressions are not mentioned in `docs.json`.
A new `returns` property has been added to expressions which determine what types an expression can return. This is currently only limited expressions that have a constant return type (i.e. not dependent on the input of the expression).Events gathered from the `@Events` annotation do not follow the `docs.json` spec.
Given that the source events cannot be gathered from the contents of the `@Events` annotation, currently, the id of the event and the name of the event are the same. Given `@Events({"x", "y"})`, the resulting json code would be:This will be properly integrated when #7668 gets merged.
StructEvent does not have docs.
Added docs.Testing Completed
Manual testing.
Supporting Information
Breaking changes
2.0.skriptVersionproperty and replaced it with thesourceproperty, which details the addon that this file was generated from.@Eventsannotation are now stored with an id and name, instead of as a plain string.returnTypeproperty for functions to an array calledreturns, similar to the newreturnsproperty on expressions.classesarray totypes.Completes: #7680
Related: none