clugg / sm-json

A pure SourcePawn JSON encoder/decoder.
GNU General Public License v3.0
82 stars 8 forks source link

compile problem #6

Closed mrc4tt closed 4 years ago

mrc4tt commented 4 years ago

Hello,

I'm using sm-json to doing compile, and using json for plugins.

I got this error, and I'm stuck over, what I need to changes:

cannot find method or property JSON_Object.GetIndexString
number of arguments does not match definition

What should I replace "JSON_Object.GetIndexString" with?

Example code:

array.GetIndexString(keyAsString, sizeof(keyAsString), i);
data.GetIndexString(keyAsString, sizeof(keyAsString), i);
mrc4tt commented 4 years ago

@clugg Do you have some idea?

B3none commented 4 years ago

Use release version 1.1.0 in the meantime as the author recently removed the function you're asking about.

clugg commented 4 years ago

Hi @MikkelDK,

GetIndexString was removed in v1.1.1 as per the release notes. I didn't make this release a major bump because I didn't expect anyone to be using the internal helper, and also because I had other major breaking changes in the pipeline that I didn't want to release simultaneously. That was a mistake on my part, so apologies for that. As of v2.0.0 an equivalent method is available on the JSON_Array methodmap: GetIndexAsString, but not available for JSON_Objects.

I will do my best to ensure I don't release breaking changes outside of major version bumps in the future, but I also recommend that you compile against a pinned version that you know works with your code.

B3none commented 4 years ago

@clugg pretty sure it’s used in Splewis’ Pugsetup.

mrc4tt commented 4 years ago

@clugg pretty sure it’s used in Splewis’ Pugsetup.

Correct as @b3none say. it's used in Splewis's Pugsetup! ;)

clugg commented 4 years ago

That is rather unfortunate! I will look into submitting a PR which moves the project to v2.0.0 if I have any spare time over the next few days.

B3none commented 4 years ago

Have you thought about adding the old functionality back in and then releasing 1.2.1? You can branch off the old version 1 release and go from there 🙂 In future any removal of functions which could be accessed by other people would be considered a breaking change.

clugg commented 4 years ago

While I don't like the idea of encouraging continued use of v1 since I have no intentions of supporting it long term, I can appreciate the fact that v1 has unnecessary breaking changes. Thanks for your suggestion - I have released v1.2.0 with the breaking change reverted.