Git Product home page Git Product logo

thrift-swift's People

Contributors

apocolipse avatar bm-w avatar cozality avatar eysteinbye avatar injeniero avatar luckfamousa avatar wyland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

thrift-swift's Issues

TJSONProtocol support to Thrift-Swift package

I needed to use TJSONProtocol for a project and hence forked and implemented the json protocol in the following fork:

https://github.com/HojjatK/Thrift-Swift

Note that I have ported the code from C# lib to Swift, the code works fine for me However I need to add more unit-tests
What's the process of If I want to send a pull-request so that it will be part of the official package?

Thank you
Hojjat

Bug in TFileTransport.read(size:)?

Hello. I'm running into an issue trying to use TFileTransport. Up front, let me say that this might be a mistake on my part as I'm new to both Thrift-Swift and Thrift in general. However, in trying to read an existing thrift file using swift code, I'm seeing a crash in TFileTransport.swift where a Data buffer is set up using:

var read = Data(capacity: size)

and then used:

read[position] = nextChar

There's no operation that changes the Data object's actual size before that write, so I believe what's going on here is that while the object has the capacity for size bytes, it's count is still zero when the write is attempted. If I've understood the issue correctly, this could be fixed by creating the Data object as a fixed-sized buffer of zeroed bytes instead of just hinting at the capacity:

var read = Data(count: size)

For context, here's how I'm calling into the thrift code:

guard let transport = try? TFileTransport(filename: filename) else { fatalError() }
try transport.open()
let proto = TBinaryProtocol(on: transport)
let d = try? MyThriftStruct.read(from: proto)

optional keyword is ignored in argument lists

Hi, how to be if I need to pass null value in method to the server,
for example
list<User> getUsers(1: AuthTokenBase64 token, 2: ID systemId, 3: othervalues othertypes);
ID is typealias for String. Parameter systemId can be value or null (on other platforms).
How do I set it as null / nil in swift ?
If thrift file has:
list<User> getUsers(1: AuthTokenBase64 token, 2: optional ID systemId, 3: othervalues othertypes);
we get this:
optional keyword is ignored in argument lists

Enum property access level / tag 1.0.7

Hello!

Faced with error (tag 1.0.7): Property 'rawValue' must be declared public because it matches a requirement in public protocol 'TEnum'

Enum in my .thrift file:

enum Gender {
	M = 0,
	F = 1
}

Thrift generated code:

enum-property-access-level

Enum failable initialization / tag 1.0.7

Hello!
Faced with issue (tag 1.0.7): 'nil' is the only return value permitted in an initializer

Enum in my .thrift file:

enum Gender {
	M = 0,
	F = 1
}

Thrift generated code:
enum-failable-init

Swift 4 support?

I'm trying to use this library in Swift 4. From what I see, there exist forks that have upgraded to swift 4 (https://github.com/apocolipse/Thrift-Swift/network). See https://github.com/Petro-Lomaka/Thrift-Swift, for example.
The framework they vend seems to work for me.

The command line thrift, on the other hand, seems not to. I'm trying to use @Petro-Lomaka's fork (same guy), but the generated code doesn't conform to the Thrift swift module. I'm currently trying to uninstall my thrift, then reinstall from brew, and then follow the instructions in #11 with the thrift fork.

Can we start the process of moving this library to swift 4?

Deploy new release with latest updates

It's been good to see this project spring back to life to, at least, get up to date with current tooling. That said, the last batch of updates won't get caught by the usual dependency managers because there is no release associated with them.

Whether there's more development planned for the near future or not, would it be a problem to add a new 1.1.1 release so folks using cocoapods/SPM will be able to grab it without forcing a dependency on master or a specific commit?

Thanks!

Let all socket communication go through a 3rd party library.

It's slightly related to #21

I'd like to see UDP support, but at the same time I'm not comfortable adding that myself since I'm pretty sure there's a lot of edge cases to tackle (especially when it comes to UDP). One thing I found that is that the on board radio on iPhones do not activate when using UDP, and you need to kick start it by using TCP first.

By using something like IBM/BlueSocket it would be easier to add support for both UDP and TCP by letting a different component handle network details.

'thrift --gen swift_3 thrift_file' not working

When I use the command will get error:

sh: thrift-gen-swift_3: command not found
plugin process returned non zero exit code: 32512
[WARNING:generation:1] Plugin generator for "swift_3" failed.

Contributing

I'd like to contribute to the repository by migrating it to the latest Swift version 5. Could someone please tell me how to set up the project on macOS 10.15.
swift build returns
"package is using Swift tools version 3.1.0 which is no longer supported; consider using '// swift-tools-version:5.1' to specify the current tools version"
After fixing this I got
"error: the package does not contain a buildable target"

Using Swift 4.2 with Thrift

Hello, I am a little new to Thrift, but it seems like according to http://thrift.apache.org/docs/Languages,
Swift 4.2 should be supported by Thrift. However, I cannot get it to compile in my project. I have Thrift version 0.12 downloaded on my mac, and used it to generate some swift files. However, all of these swift files have the line "Import Thrift" in them, to which the error "No such module 'Thrift' " pops up. If I place in my podfile [pod 'Thrift-swift3', :git => '[email protected]:apache/thrift.git', :branch => 'master'] or [pod "thrift"], the code does not compile because it seems the version of swift it was written is outdated. If anyone could give give me some insight that would be much appreciated. Sorry if this is a dumb question, but I am at a loss after searching the internet for hours for a solution. Thanks!

Wrong git tag

Tag needs to be updated and it should be named โ€œ0.0.1โ€.

Swift 4.1: '_rawValue' is inaccessible due to 'private' protection level

image

On TSocketTransport.swift:87:113, using Swift 4.1, there is a compiling issue of type '_rawValue' is inaccessible due to 'private' protection level. It looks like converting a string enum to raw value is deprecated start Swift 4.1
I wonder how we'd like to proceed with this change ๐Ÿค”

Invalid redeclaration of 'description' / tag 1.0.7

Hello!
Faced with issue (tag 1.0.7): Invalid redeclaration of 'description'
appears in all classes where description property exists

Up to tag 1.0.6 there was no issue.

My struct in .thrift file:

struct TCountryInfo {
	1: ID id,
	2: string title,
	3: string subtitle,
	4: string description,
	5: string image,
	6: ID countryId,
	7: Attributes attributes
}

Thrift generated code for this struct:
class-property

class-extension

Thrift not compiles on Xcode 8

Hello! I have installed thrift via cocoapods. And my project not compiled on Xcode 8 with latest ios10.3 SDK. There are more then 100 errors in Thrift framework. What is problem? The library isn't contributed anymore?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.