Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add flag to drop the limit of json depth #156

Merged
merged 3 commits into from
Jul 9, 2023
Merged

add flag to drop the limit of json depth #156

merged 3 commits into from
Jul 9, 2023

Conversation

shoothzj
Copy link
Collaborator

@shoothzj shoothzj commented Jul 7, 2023

No description provided.

Copy link
Contributor

@UrielCh UrielCh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the default parser flag should be 0
the limit should be enabled by default.
the flag name should be called:
UNLIMITED_JSON_DEPTH and do the opposite.

}
String s = sb.toString();
try {
JSONParser parser = new JSONParser(DEFAULT_PERMISSIVE_MODE & ~JSONParser.FINITE_JSON_DEPTH);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why FINITE_JSON_DEPTH could not benefit of an import static wherever DEFAULT_PERMISSIVE_MODE can.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEFAULT_PERMISSIVE_MODE & ~FINITE_JSON_DEPTH ?
should be:
DEFAULT_PERMISSIVE_MODE | FINITE_JSON_DEPTH ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not remember this code, but I think that the default parser value is 0
...
So the issue is that the flag should be call UNLIMITED_JSON_DEPTH and do the opposite.
The limit is enabled by default for now, and can be disabled in some rare cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to the fixed version should be: DEFAULT_PERMISSIVE_MODE | UNLIMITED_JSON_DEPTH

@UrielCh
Copy link
Contributor

UrielCh commented Jul 7, 2023

after reading the code:

	/**
	 * smart mode, fastest parsing mode. accept lots of non standard json syntax
	 * 
	 * @since 1.0.6
	 */
	public final static int MODE_PERMISSIVE = -1;

The MODE_PERMISSIVE is the mode I use by default for my stuff.

	/**
	 * Default json-smart processing mode
	 */
	public static int DEFAULT_PERMISSIVE_MODE = (System.getProperty("JSON_SMART_SIMPLE") != null) ? MODE_JSON_SIMPLE
			: MODE_PERMISSIVE;

what...
I do not remember....

what is the default mode ?
the default mode should keep the limit.

@UrielCh
Copy link
Contributor

UrielCh commented Jul 7, 2023

I remember my way of codding.
The ~ tild operator should be avoid. Check the rest of the code I did not used any of them.

@shoothzj
Copy link
Collaborator Author

shoothzj commented Jul 8, 2023

@UrielCh I agree with that the limited ability should be enabled by default. But the default value is -1, not 0.

@UrielCh
Copy link
Contributor

UrielCh commented Jul 8, 2023

Change the since.
bump the version number and that should be done,

bump minor or patch ?
since you add a new flag that a minor upgrade. so change the second digit, and set the third one to 0.

@UrielCh
Copy link
Contributor

UrielCh commented Jul 8, 2023

so the next version is V 2.5.0

@shoothzj shoothzj changed the title [WIP] add flag to drop the limit of json depth add flag to drop the limit of json depth Jul 9, 2023
@shoothzj
Copy link
Collaborator Author

shoothzj commented Jul 9, 2023

@UrielCh I have done bump the minor versions. But I think we can't avoid using ~ since the default mode is -1.

@UrielCh UrielCh merged commit 54eb6f0 into master Jul 9, 2023
1 check passed
@shoothzj shoothzj deleted the add-flag branch July 10, 2023 00:25
github-merge-queue bot pushed a commit to camunda/camunda that referenced this pull request Mar 28, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [net.minidev:json-smart](https://urielch.github.io/)
([source](https://togithub.com/netplex/json-smart-v2)) | `2.4.10` ->
`2.5.1` |
[![age](https://developer.mend.io/api/mc/badges/age/maven/net.minidev:json-smart/2.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/net.minidev:json-smart/2.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/net.minidev:json-smart/2.4.10/2.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/net.minidev:json-smart/2.4.10/2.5.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>netplex/json-smart-v2 (net.minidev:json-smart)</summary>

###
[`v2.5.1`](https://togithub.com/netplex/json-smart-v2/releases/tag/2.5.1):
V 2.5.1

[Compare
Source](https://togithub.com/netplex/json-smart-v2/compare/2.5.0...2.5.1)

#### What's Changed

- Bump junit.version from 5.9.3 to 5.10.0 in /json-smart by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#158
- Bump junit.version from 5.9.3 to 5.10.0 in /json-smart-action by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#157
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.5.0 to 3.6.2
in /json-smart by [@&#8203;dependabot](https://togithub.com/dependabot)
in
[netplex/json-smart-v2#166
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.5.0 to 3.6.2
in /json-smart-action by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#165
- Bump junit.version from 5.10.0 to 5.10.1 in /json-smart-action by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#164
- Bump junit.version from 5.10.0 to 5.10.1 in /json-smart by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#163
- chore: Update github id from Shoothzj to shoothzj by
[@&#8203;shoothzj](https://togithub.com/shoothzj) in
[netplex/json-smart-v2#168
- Bump asm version from 9.3 to 9.6 by
[@&#8203;shoothzj](https://togithub.com/shoothzj) in
[netplex/json-smart-v2#167
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.2 to 3.6.3
in /json-smart-action by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#169
- Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.2 to 3.6.3
in /json-smart by [@&#8203;dependabot](https://togithub.com/dependabot)
in
[netplex/json-smart-v2#170
- Bump org.apache.maven.plugins:maven-compiler-plugin from 3.11.0 to
3.12.0 in /json-smart by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#172
- Bump org.apache.maven.plugins:maven-compiler-plugin from 3.11.0 to
3.12.0 in /json-smart-action by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#171
- Bump org.apache.maven.plugins:maven-compiler-plugin from 3.12.0 to
3.12.1 in /json-smart by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#174
- Bump org.apache.maven.plugins:maven-compiler-plugin from 3.12.0 to
3.12.1 in /json-smart-action by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#173
- Fix OSGi import package version for net.minidev.asm. by
[@&#8203;msqr](https://togithub.com/msqr) in
[netplex/json-smart-v2#180
- Bump junit.version from 5.10.1 to 5.10.2 in /json-smart-action by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#179
- Bump junit.version from 5.10.1 to 5.10.2 in /json-smart by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#178
- Bump version from 2.5.0 to 2.5.1 by
[@&#8203;shoothzj](https://togithub.com/shoothzj) in
[netplex/json-smart-v2#181
- docs: add change log for version 2.5.1 by
[@&#8203;shoothzj](https://togithub.com/shoothzj) in
[netplex/json-smart-v2#182
- Update 2024 by [@&#8203;UrielCh](https://togithub.com/UrielCh) in
[netplex/json-smart-v2#183
- add somme doc to remove deployement warnings by
[@&#8203;UrielCh](https://togithub.com/UrielCh) in
[netplex/json-smart-v2#184

#### New Contributors

- [@&#8203;msqr](https://togithub.com/msqr) made their first
contribution in
[netplex/json-smart-v2#180

**Full Changelog**:
netplex/json-smart-v2@2.5.0...2.5.1

###
[`v2.5.0`](https://togithub.com/netplex/json-smart-v2/releases/tag/2.5.0):
V 2.5.0

[Compare
Source](https://togithub.com/netplex/json-smart-v2/compare/2.4.11...2.5.0)

#### What's Changed

- Bump maven-bundle-plugin from 5.1.8 to 5.1.9 in /json-smart-action by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#148
- Bump maven-bundle-plugin from 5.1.8 to 5.1.9 in /json-smart by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#149
- Bump maven-source-plugin from 3.2.1 to 3.3.0 in /json-smart by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#151
- Bump maven-source-plugin from 3.2.1 to 3.3.0 in /json-smart-action by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#150
- Bump maven-release-plugin from 3.0.0 to 3.0.1 in /json-smart-action by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#152
- Bump maven-release-plugin from 3.0.0 to 3.0.1 in /json-smart by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#153
- add flag to drop the limit of json depth by
[@&#8203;Shoothzj](https://togithub.com/Shoothzj) in
[netplex/json-smart-v2#156

**Full Changelog**:
netplex/json-smart-v2@2.4.11...2.5.0

###
[`v2.4.11`](https://togithub.com/netplex/json-smart-v2/releases/tag/2.4.11):
V 2.4.11

[Compare
Source](https://togithub.com/netplex/json-smart-v2/compare/2.4.10...2.4.11)

##### *V 2.4.11* (2023-05-18)

- Fix error in isWritable in accessor-smart. [PR
147](https://togithub.com/netplex/json-smart-v2/pull/147)
-   Update json-smart dependency to use accessor-smart:2.4.11

#### What's Changed

- Bump maven-release-plugin from 3.0.0-M7 to 3.0.0 in /json-smart-action
by [@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#135
- Bump maven-release-plugin from 3.0.0-M7 to 3.0.0 in /json-smart by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#136
- Bump maven-resources-plugin from 3.3.0 to 3.3.1 in /json-smart by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#138
- Bump maven-resources-plugin from 3.3.0 to 3.3.1 in /json-smart-action
by [@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#139
- Fix the grammar in the Readme by
[@&#8203;wirelessben](https://togithub.com/wirelessben) in
[netplex/json-smart-v2#140
- Bump junit.version from 5.9.2 to 5.9.3 in /json-smart-action by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#144
- Bump junit.version from 5.9.2 to 5.9.3 in /json-smart by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#143
- Fix CVE from being reported against accessors-smart by
[@&#8203;Grimoren](https://togithub.com/Grimoren) in
[netplex/json-smart-v2#142
- Bump maven-gpg-plugin from 3.0.1 to 3.1.0 in /json-smart-action by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#146
- Bump maven-gpg-plugin from 3.0.1 to 3.1.0 in /json-smart by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[netplex/json-smart-v2#145
- Fix isWritable method by
[@&#8203;harikrishna553](https://togithub.com/harikrishna553) in
[netplex/json-smart-v2#147

#### New Contributors

- [@&#8203;wirelessben](https://togithub.com/wirelessben) made their
first contribution in
[netplex/json-smart-v2#140
- [@&#8203;Grimoren](https://togithub.com/Grimoren) made their first
contribution in
[netplex/json-smart-v2#142
- [@&#8203;harikrishna553](https://togithub.com/harikrishna553) made
their first contribution in
[netplex/json-smart-v2#147

**Full Changelog**:
netplex/json-smart-v2@2.4.10...2.4.11

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 10pm every weekday,before 6am
every weekday" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/camunda/zeebe).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants